[R] Newbie question on subsets

Joe Trubisz jtrubisz at mac.com
Sun Jan 20 04:11:52 CET 2008


Hi...

I'm working through the book, A Handbook of Statistical Analyses  
using R by Everitt, and I'm trying to do the following (p. 19 of his  
book):

boxplot(log(marketvalue)~country,
   data = subset(Forbes2000,
                             country %in% c("United  
Kingdom","Germany","India","Turkey")),
   ylab="log(marketvalue",
   varwidth=TRUE)

This *almost* works, but I'm getting ALL the countries on the x-axis,  
not just the 4-specified.
I tried tinkering with variations in the subset command to no avail.

Can someone tell me what's wrong/missing with the above command?

Thanks,
Joe



More information about the R-help mailing list