Re: [R] subset and boxplots

From: Sebastian P. Luque <spluque_at_gmail.com>
Date: Tue, 22 Apr 2008 11:29:33 -0500

On Tue, 22 Apr 2008 07:55:41 -0800,
"Marlin Keith Cox" <marlinkcox_at_gmail.com> wrote:

> R users, This should be simple, but I cannot figure it out. I import
> test.csv, then create a subset for "brook_dis". When I plot (week, R)
> I get a nice boxplot, but along the x axis, there are weeks a, b, c
> along with h and nh.

That's because the levels are still there. To get rid of all them (for all factors in the data frame):

sub[] <- lapply(sub, "[", drop=TRUE)

after subset()'ing.

-- 
Seb

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Tue 22 Apr 2008 - 16:43:34 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 22 Apr 2008 - 17:30:31 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive