On Thu, May 20, 2010 at 10:31 AM, Joshua Wiley <jwiley.ps...@gmail.com>wrote:
> Dear Mohan, > > First, I would like to modify my code slightly to: > > data <- rbind(data,data.frame(State="Total",t(apply(data[,-1], 2, sum, > na.rm=TRUE)))) > > This actually will add a 7th level to your factor automatically. The > reason I wanted to change from using c() to data.frame() is that if > one uses c(), all the columns are converted to character (this has to > do with different methods for rbind, see ?rbind particularly the > Details and Value section which describe the different methods for > rbind and what its behavior will be if it is using the default > method). This may not be an issue, but it would hamper any subsequent > calculations you may wish to perform on your data. > Thanks for your great help. Mohan L [[alternative HTML version deleted]] ______________________________________________ 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.