by frankc · 13y ago · 0 comments
foo <-read.csv("foo.csv")
Getting summary descriptive statistics, item counts, scatter plots and histograms is often as easy as
summary(foo)
table(foo$col)
plot(foo$xcol, foo$ycol)
hist(foo$col).
I think that is lot simpler than a 4 or 5 command pipeline that can be mistake-prone to edit when you want to change column names or things like that. I still do these kinds of things in the shell sometimes, and I don't know if I can put my finger on when exactly I would drop into R vs write out a pipeline, but there IS a line somewhere...
R also supports the use of atomic operations on vectors (it automatically maps the operation over the vector), and other idioms that would be liabilities in other programming languages, but hugely beneficial in this one area.
I still haven't found a language that treats reading (and then processing) a CSV file more easily than R.
Conveniently, R should be really easy to pick up for someone familiar with working with a POSIX shell or Bash. For example, to see all variables defined in the current namespace, just type ls().
R is basically the POSIX mentality applied specifically to data processing, instead of general-purpose work.
That said, I've got my own univariate statistics generator written in awk that can handle sets with millions of values readily on desktop/laptop hardware.
Which isn't to say that it's not a phenomenally powerful and capable tool. I'm just referring to its accessibility.