Re: [R] subset and boxplots

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

On Tue, 22 Apr 2008 07:55:41 -0800,
"Marlin Keith Cox" <> 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.


______________________________________________ mailing list
PLEASE do read the posting guide
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 Please read the posting guide before posting to the list.

list of date sections of archive