How to make a dataframe from a vector or matrix? thanks, yan
a quick Q on dataframe
3 messages · Yan Yu, Andrew C. Ward, Spencer Graves
?as.data.frame ?cbind.data.frame Regards, Andrew C. Ward CAPE Centre Department of Chemical Engineering The University of Queensland Brisbane Qld 4072 Australia andreww at cheque.uq.edu.au Quoting Yan Yu <yanyu at cs.ucla.edu>:
How to make a dataframe from a vector or matrix? thanks, yan
______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
dimnames(amat) <- list(letters[1:2], LETTERS[3:4])
> data.frame(amat) C D a 1 3 b 2 4 > as.data.frame(amat) C D a 1 3 b 2 4 > Read "?data.frame" to see the difference between "data.frame" and "as.data.frame". hth Spencer Graves
Yan Yu wrote:
How to make a dataframe from a vector or matrix? thanks, yan
______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help