Skip to content
Prev 45068 / 63424 Next

stringsAsFactors

On Wed, Feb 13, 2013 at 7:33 AM, Michael Dewey <info at aghmed.fsnet.co.uk> wrote:
Your data must reach you in a much better state than mine reaches me.
I spend most of my time organizing, combining, fixing typos,
reshaping, merging and so on. Then I see the dreaded warning

"In `[<-.factor`(`*tmp*`, 6, value = "z") :
  invalid factor level, NAs generated

which reminds me that I've forgotten to set stringsAsFactors=FALSE.
However, I'm not saying I don't like factors. Once the data is cleaned
up they are very useful. But often I find that when I'm trying to
clean up a messy data set they just get in the way. And since that is
what I spend most of my time doing, factors get in the way most of the
time for me.