Re: [R] factor question

From: Henrique Dallazuanna <wwwhsd_at_gmail.com>
Date: Thu, 24 Jul 2008 16:23:02 -0300

Try:

fac1[3:9][drop=T]

On Thu, Jul 24, 2008 at 4:19 PM, Edna Bell <edna.bell01_at_gmail.com> wrote:
> Hi!
>
> Suppose I have a factor:
>
>> fac1 <- factor(rep(c("dog","cat","tree"),c(2,3,4)))
>> fac1
> [1] dog dog cat cat cat tree tree tree tree
> Levels: cat dog tree
>> length(fac1)
> [1] 9
>
> Now I want to get rid of the dogs:

>> fac1 <- fac1[3:9]
>> fac1
> [1] cat cat cat tree tree tree tree
> Levels: cat dog tree
>>
> How should I remove the dog from the level, please?
>
> Thanks in advance,
> Edna Bell
>
> ______________________________________________
> 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.
>

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

______________________________________________
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 Thu 24 Jul 2008 - 19:25: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 Thu 24 Jul 2008 - 19:32:25 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