Re: [R] Assign Character Value to Data Frame

2011-04-12 Thread Sarah Goslee
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()

Re: [R] Assign Character Value to Data Frame

2011-04-12 Thread Joshua Wiley
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

[R] Assign Character Value to Data Frame

2011-04-12 Thread Sparks, John James
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