I have a function in which I define a data.frame
that I use loops to fill with data. At some point I get the Warning message:
Warning messages: 1: In
[<-.factor
(*tmp*
, iseq, value = "CHANGE") : invalid factor level, NAs generated
Therefore, when I define my data.frame, I'd like to set the option stringsAsFactors
to FALSE
but I don't understand how to do it.
I have tried:
DataFrame = data.frame(stringsAsFactors=FALSE)
and also:
options(stringsAsFactors=FALSE)
What is the correct way to set the stringsAsFactors option?
See Question&Answers more detail:os