Re: [R] factor level for non-existing value

2012-02-09 Thread Ista Zahn
Hi David, On Thursday, February 09, 2012 01:21:48 PM David Studer wrote: > Hello everybody! > > Let's assume I have the following factor with it's levels: > > a<-factor(c(2,3,3,2,4,2,3,2,2,2,3,2,3)) > mydata<-data.frame(a) #You need to specify levels and labels here, like this: a <- factor(c(2

Re: [R] factor level for non-existing value

2012-02-09 Thread Petr PIKAL
Hi > > Hello everybody! > > Let's assume I have the following factor with it's levels: > > a<-factor(c(2,3,3,2,4,2,3,2,2,2,3,2,3)) > mydata<-data.frame(a) > > When I plot the vector "a" using > > barplot(table(mydata$a) > > unfortunately the value "1" does not > show up, as it does not appea