I wish I knew everything about R. I wish I could vectorise in my…

July 12, 2011
By

(This article was first published on awaiting assimilation, and kindly contributed to R-bloggers)



I wish I knew everything about R. I wish I could vectorise in my sleep. I wish there were perfect R packages out there to solve all my data transformation problems. I wish there were perfect data.

If I were Paul Graham, would I ever write code like the above? Would I hire someone who wrote that, if I were Joel Spoelsky?

My code smells, but I’ve spoken with a few experts in our department whom I trust, and they agree that the approach I’m taking is sound. I’m transforming data to be fed into a Cox model. Each data row contains a start and end date, event boolean, outcome boolean, number of prior events, and number of prior outcomes. There’s also an array of rules by which to construct the data, including those that involve season start and end dates, event start and end dates, events spanning multiple data rows, etc. Oh, and I’m using a big loop rather than vectorization. 

This project has made me question my ability to solve problems in software, which is humbling, but I soldier on.

To leave a comment for the author, please follow the link and comment on his blog: awaiting assimilation.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags:

Comments are closed.