Re: [R] Levels of a factor

2013-07-25 Thread Borja Rivier
D" "F" "G" "H" "J" "K" "L" "M" "N" "O" "P" "Q" > "R" "S" "T" "V" "X" > # [20] "Y" "Z" > > There are times wh

Re: [R] Levels of a factor

2013-07-24 Thread David Carlson
; "P" "Q" "R" "S" "T" "V" "X" # [20] "Y" "Z" There are times when you want to know if certain factor levels do not appear in a subset of the original data. - David L Carls

Re: [R] Levels of a factor

2013-07-24 Thread David Winsemius
On Jul 24, 2013, at 11:35 AM, David Winsemius wrote: > > On Jul 24, 2013, at 6:25 AM, Borja Rivier wrote: > >> Hi all, >> >> I am having a bit of trouble using the levels() function. >> I have a factor with many elements, and when I use the function levels() to >> extract the list of unique el

Re: [R] Levels of a factor

2013-07-24 Thread David Winsemius
On Jul 24, 2013, at 6:25 AM, Borja Rivier wrote: > Hi all, > > I am having a bit of trouble using the levels() function. > I have a factor with many elements, and when I use the function levels() to > extract the list of unique elements, some of the elements returned are not > actually in the fa

Re: [R] Levels of a factor

2013-07-24 Thread arun
Hi,  vec1<- factor(1:5,levels=1:10)  vec1 #[1] 1 2 3 4 5 #Levels: 1 2 3 4 5 6 7 8 9 10 vec2<-droplevels(vec1)  levels(vec2) #[1] "1" "2" "3" "4" "5"  vec2 #[1] 1 2 3 4 5 #Levels: 1 2 3 4 5 A.K. Hi all, I am having a bit of trouble using the levels() function. I have a factor with many element

[R] Levels of a factor

2013-07-24 Thread Borja Rivier
Hi all, I am having a bit of trouble using the levels() function. I have a factor with many elements, and when I use the function levels() to extract the list of unique elements, some of the elements returned are not actually in the factor. For example I would have this: > vector <- dataset$Benc