This look really interesting but I don't understand what is happening.
Please can someone explain the last line and what the bit in [] is doing.
Ian

df = data.frame( A=c('a','b','c'), B=c(1,2,3), C=c(10,20,30),
stringsAsFactors=FALSE)

newrow = c('X', 100, 200)

rbind(df,newrow)[c(1,4,2,3),]

______________________________________________
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.

Reply via email to