Monthly Archives: May 2012

what’s wrong with package comment?!

May 3, 2012
By
what’s wrong with package comment?!

I spent most of the Sunday afternoon trying to understand why defining did not have the same effect as writing the line until I found there is a clash due to the comment package… The assuredly simple code produces an error message: This is quite an inconvenience as I need to compile my solution manual

Read more »

RegEx: Named Capture in R

May 3, 2012
By

I consider myself a decent RegEx user.  References to famous quotes about RegEx aside, I find it intuitive, like its speed and that it makes my code simple (more so than the alternative anyhow). Thus, I use RegEx where I can in the growing grab bag of languages I consider myself proficient in: *nix command line / shell scripts Javascript PHP Matlab Python R Now...

Read more »

Theme Elements in ggplot2

May 3, 2012
By

This website provides a simple summary of the theme elements that can be set within ggplot2. There should be sufficient information here to change the default settings for graphs within the ggplot2 package.

Read more »

cumplyr: Extending the plyr Package to Handle Cross-Dependencies

May 3, 2012
By

Introduction For me, Hadley Wickham‘s reshape and plyr packages are invaluable because they encapsulate omnipresent design patterns in statistical computing: reshape handles switching between the different possible representations of the same underlying data, while plyr automates what Hadley calls the Split-Apply-Combine strategy, in which you split up your data into several subsets, perform some computation

Read more »

Google Translate for code, and an R help-list bot

May 3, 2012
By

What we did in our Stan meeting yesterday: Some discussion of revision of the Nuts paper, some conversations about parameterizations of categorical-data models, plans for the R interface, blah blah blah. But also, I had two exciting new ideas! Google Translate for code Wouldn’t it be great if Google Translate could work on computer languages? The post Google...

Read more »

How to plot three categorical variables and one continuous variable using ggplot2

May 3, 2012
By
How to plot three categorical variables and one continuous variable using ggplot2

This post shows how to produce a plot involving three categorical variables and one continuous variable using ggplot2 in R. The following code is also available as a gist on github. 1. Create Data First, let's load ggplot2 and create some data to work...

Read more »

An ivreg2 function for R

May 3, 2012
By
An ivreg2 function for R

The ivreg2 command is one of the most popular routines in Stata. The reason for this popularity is its simplicity. A one-line ivreg2 command generates not only the instrumental variable regression coefficients and their standard errors, but also a number of other statistics of interest. I have come across a number of functions in R

Read more »

reshape (from base) Explained: Part I

May 2, 2012
By
reshape (from base) Explained: Part I

This Post Will Explain the Basics of Wide to Long With base reshape (part I) Often your data set is in wide format and some sort of analysis or visualization requires putting the data set into long format.  Hadely Wickham … Continue reading →

Read more »

Yes, you need more than just R for Big Data Analytics

May 2, 2012
By

Douglas Merrill, former CIO/VP of Engineering at Google, writes in Forbes about using the R language for data analysis: Most folks with math-oriented graduate degrees will have written something in R, a non-commercial option for your big data analysis. So, great graduates from great graduate schools know great tools. His post is titled 'R Is Not Enough For "Big...

Read more »

Doodling With a Conversation, or Retweet, Data Sketch Around LAK12

May 2, 2012
By
Doodling With a Conversation, or Retweet, Data Sketch Around LAK12

How can we represent conversations between a small sample of users, such as the email or SMS converstations between James Murdoch’s political lobbiest and a Government minister’s special adviser (Leveson inquiry evidence), or the pattern of retweet activity around a couple of heavily retweeted individuals using a particular hashtag? I spent a bit of time

Read more »