That column of your data frame contains a factor, rather than character
values. You don't tell us how you created the data frame, but you might
be interested in the stringsAsFactors option to data.frame() and read.table().
Or, if you do actually want a factor for that column, you can use factor()
Hi John,
The error arises because the "hold" data frame contains factors. This
happens by default when creating data frames with character data as
you did. Factors have a set number of levels and new values cannot be
assigned to them that fall outside their specified levels, hence the
error. Th
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:
> test<-data.frame(number=numeric(1))
> test[1,]<-.5
> test
number
10.5
But t
3 matches
Mail list logo