[R] R not recognizing words

peter dalgaard pdalgd at gmail.com
Fri Jan 6 11:30:33 CET 2012


On Jan 6, 2012, at 06:20 , arabarkev wrote:

> Hello all
> 
> I'm new to R and am experiencing a problem with a categorical variable.  All
> the data of this variable are "Low", "High", or NA.  When I put
> summary(x$y), it gives me the number of High, Low, and NA entries.  However,
> when I try to subset by writing     x$y=="Low"  or x$y=="High", R does not
> recognize the word and it writes FALSE for all the entries (but not the NA
> entries). 
> 
> Can anybody help me out?

Trailing whitespace? Check levels(x$y)

> 
> Thanks
> 
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/R-not-recognizing-words-tp4268283p4268283.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> 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.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list