Skip to content
Prev 256632 / 398506 Next

Assign Character Value to Data Frame

Dear R Helpers,

I am trying to write a character value to the row of a data frame and am
running into a problem that I don't have when I do this for numeric
arguments.  For example, the following works just fine:
number
1    0.5

But the following bombs out:
Warning message:
In `[<-.factor`(`*tmp*`, iseq, value = "NYSE:MMM") :
  invalid factor level, NAs generated

Could someone please guide me as to what adjustment I need to make to
assign this character value to this row of the data frame?  Your help
would be very much appreciated.

--John Sparks