I imported a csv into R and it considers my variable FERNH a factor; it isn\'t. I can\'t figure out why or how to fix it. I have reviewed the values in FERNH and they appear t
There is a character
value in there somewhere so R is acting as expected. Look at levels(height$FERNH)
to see the offending value. You can set stringsAsFactors=FALSE
on your read step or via options
, but then the column will be a character
rather than integer
.
While that may seem annoying at first, it is an excellent data quality check as well as significant memory savings if the character column contains long strings.