Friday, July 13, 2012

Connecting R to TextWrangler

TextWrangler is a handy text editor for writing code in R.  You can interface it with R by saving a file available here and here to the TextWrangler folder in your Application Support directory. 

One important instalation note: there are two Application Support directories, at least on my MacBook - one under MacintoshHD and one under my user name.  Only the one under my username contains the Text Wrangler folder.  The links above have full instalation information, minus this caveat.

The use of TextWrangler for general text editing and scripting is also discussed in the excellent book Practical Computing for Biologists.

Tuesday, January 3, 2012

R in action: "R is hot" whitepaper from Revolution Analytics

R is hot

from the Revolution Analytics website:

R is Hot
by David Smith

R has already won praise and plaudits from established media outlets such as the New York Times, Forbes, Intelligent Enterprise, InfoWorld and The Register. When you consider that R is a high-level computer programming language designed mostly for quants, the adoring media attention seems nothing short of astounding.

So it’s entirely fair to ask: Why all the hoopla? Why is an esoteric programming language created in the early 1990s by two academics in New Zealand suddenly all the rage? Why is R so hot?

This article examines the reasons behind the rising popularity of R, by looking at how R is used at organizations including Bank of America, National Institutes of Health, the New York Times and Deloitte Consulting.

R in action: How Mariano Rivera Dominates Hitters

How Mariano Rivera Dominates Hitters

a New York times animated news story on relief pitcher Mariano Rivera. Analysis and some graphics done in R.

R in action: "Shorting Cramer"

The data analysis conducted for this article was done using R.
"Shorting Cramer" by Bill Alpert, Barons, 2007.

Sunday, December 25, 2011

readLines

for data import

http://stackoverflow.com/questions/2628680/how-to-import-a-csv-file-containing-multiple-sections-into-r

count.fields

count.fields

see for using this function in a situation with difficult loading a csv file

http://stackoverflow.com/questions/8568968/r-programming-read-csv-skips-lines-unexpectedly

Wednesday, November 30, 2011

Convert a continous variable to a factor using quantiles

package gtools

function quantcut()

http://hosho.ees.hokudai.ac.jp/~kubo/Rdoc/library/gtools/html/quantcut.html