Archives
Categories
Monthly Archives: June 2009
Eval in R: Running Code From a String
It’s (very) occasionally quite useful to be able to execute code from a string, similarly to eval in ruby or javascript. You might use this to, eg, read a directory full of csv files and turn each filename into a … Continue reading
Posted in R, R Tip
Leave a comment
Column Names of R Data Frames
Say you read a data frame from a file but you don’t like the column names. Here’s how you go about labelling them as you like. Start with a simple csv file: col1, col2, col3 “1,233″, “$12.79″, “$1,333,233.17″ “470″, “$1,113.22″, … Continue reading
Posted in Data Munging, R
Leave a comment
Cleaning Data in R: csv files
When you read csv files, you regularly encounter Excel encoded csv files which include extraneous characters such as commas, dollar signs, and quotes. Such a file might look like col1, col2, col3 “1,233″, “$12.79″, “$1,333,233.17″ “470″, “$1,113.22″, “$0.12″ and call … Continue reading
Posted in Data Munging, R
1 Comment
Using R
I intend to talk about a bunch of things, mostly involving R, that I had to learn the hard way. Hopefully this will not only serve as a set of notes for me but help someone else out along the … Continue reading
Posted in R
Leave a comment