I am calculating some values that I am inserting into a data frame. From what I have read, creating the dataframe ahead of time is more efficient, since rbind (so far the only solution I have found to appending to a data frame) is not very fast.
What I am doing is the following: # create data frame goframe = data.frame(goA = character(10), goB = character(10), value = numeric(10)) goframe[1,] = c("AA", "BB", 0.4) Result is: > goframe[1,] = c("AA", "BB", 0.4) Warning messages: 1: In `[<-.factor`(`*tmp*`, iseq, value = "AA") : invalid factor level, NAs generated 2: In `[<-.factor`(`*tmp*`, iseq, value = "BB") : invalid factor level, NAs generated > Is there another/better/more recomended way of doing this? If not, how do I do this without getting all the warnings? Thanks! Best, Karin Lagesen ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.