[R] Remove levels

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Thu Jun 13 15:55:57 CEST 2013


Please read the Posting Guide, which among other things points out that you should be posting in plain text format, not HTML (which tends to corrupt example R code).

Then please explain why your problem is not addressed by the below referenced section of the R Inferno. You may need to read [1] for advice on providing a reproducible example per the Posting Guide so we can follow your argument clearly.

[1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

Shane Carey <careyshan at gmail.com> wrote:

>Nope, but thanks
>
>
>On Thu, Jun 13, 2013 at 1:11 PM, Albin Blaschka <
>albin.blaschka at standortsanalyse.net> wrote:
>
>>
>>
>> Am 13.06.2013 14:02, schrieb Shane Carey:
>>
>>  I have a dataframe consisting of factors in one column. Im trying to
>>> remove
>>> certain levels using the following code:
>>> toBeRemoved1<-which(DATA$**UnitName_1=="lake")
>>> DATA<-DATA[-toBeRemoved1,]
>>>
>>> However it will not remove the level "lake"
>>>
>>
>> Hello!
>>
>> Is this a part of the R Inferno?
>> See "The R Inferno" from Patrick Burns, specially Chapter 8.2.4
>"dropping
>> factor levels ", page 83
>>
>>
>http://www.burns-stat.com/**pages/Tutor/R_inferno.pdf<http://www.burns-stat.com/pages/Tutor/R_inferno.pdf>
>>
>> HTH,
>> Albin
>>
>>
>> --
>> | Albin Blaschka, Mag.rer.nat.
>> | Etrichstrasse 26, A-5020 Salzburg
>> | * www.albinblaschka.info * www.thinkanimal.info *
>> | - It's hard to live in the mountains, hard but not hopeless!
>>
>> ______________________________**________________
>> R-help at r-project.org mailing list
>>
>https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
>> PLEASE do read the posting guide http://www.R-project.org/**
>> posting-guide.html <http://www.R-project.org/posting-guide.html>
>> and provide commented, minimal, self-contained, reproducible code.
>>



More information about the R-help mailing list