Biologist
Department of the Interior
US Fish & Wildlife Service
California, USA
http://www.fws.gov/redbluff/rbdd_jsmp.aspx
From: "Schreiber, Stefan"
To: r-help@r-project.org
Sent: Tuesday, November 1, 2011 2:28 PM
Subje
e Interior
US Fish & Wildlife Service
California, USA
http://www.fws.gov/redbluff/rbdd_jsmp.aspx
From: "Schreiber, Stefan"
>To: r-help@r-project.org
>Sent: Tuesday, November 1, 2011 2:28 PM
>Subject: [R] factor level issue after subsetting
>
>Dear list,
>
>I cannot
first of all, the subsetting line is overly complicated.
dat.sub<-dat[dat$treat!='cont',]
will work just fine. R does exactly what you're describing. It knows
the levels of the factor. Once you remove 'cont' from the data, that
doesn't mean that the level is removed from the factor:
> df<-dat
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Schreiber, Stefan
> Sent: Tuesday, November 01, 2011 2:29 PM
> To: r-help@r-project.org
> Subject: [R] factor level issue after subsetting
>
> Dear li
Dear list,
I cannot figure out why, after sub-setting my data, that particular item
which I don't want to plot is still in the newly created subset (please
see example below). R somehow remembers what was in the original data
set. A work around is exporting and importing the new subset. Then it's
5 matches
Mail list logo