Articles by Luis

Setting plots side by side

October 11, 2011 | Luis

This is simple example code to display side-by-side lattice plots or ggplot2 plots, using the mtcars dataset that comes with any R installation. We will display a scatterplot of miles per US gallon (mpg) on car weight (wt) next to … Continue reading → [Read more...]

Upgrading R (and packages)

October 10, 2011 | Luis

I tend not to upgrade R very often—running from 6 months to 1 year behind in version numbers—because I had to reinstall all packages: a real pain. A quick search shows that people have managed to come up with good … Continue reading → [Read more...]

Reading HTML pages in R for text processing

October 10, 2011 | Luis

We were talking with one of my colleagues about doing some text analysis—that, by the way, I have never done before—for which the first issue is to get text in R. Not any text, but files that can be accessed … Continue reading → [Read more...]

Operating on datasets inside a function

October 9, 2011 | Luis

There are times when we need to write a function that makes changes to a generic data frame that is passed as an argument. Let’s say, for example, that we want to write a function that converts to factor any … Continue reading → [Read more...]

A brief idea of style

October 8, 2011 | Luis

Once one starts writing more R code the need for consistency increases, as it facilitates managing larger projects and their maintenance. There are several style guides or suggestions for R; for example, Andrew Gelman’s, Hadley Wickham’s, Bioconductor’s and this one. … Continue reading → [Read more...]

All combinations for levelplot

October 7, 2011 | Luis

In a previous post I explained how to create all possible combinations of the levels of two factors using expand.grid(). Another use for this function is to create a regular grid for two variables to create a levelplot or a … Continue reading → [Read more...]

On R versus SAS

October 6, 2011 | Luis

A short while ago there was a discussion on linkedin about the use of SAS versus R for the enterprise. I have thought a bit about the issue but, as I do not use Linkedin, I did not make any … Continue reading → [Read more...]

Linear regression with correlated data

October 5, 2011 | Luis

I started following the debate on differential minimum wage for youth (15-19 year old) and adults in New Zealand. Eric Crampton has written a nice series of blog posts, making the data from Statistics New Zealand available. I will use … Continue reading → [Read more...]
1 3 4 5

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)