[R] a quick Q on dataframe

Spencer Graves spencer.graves at pdf.com
Thu Apr 17 17:01:48 CEST 2003


 > 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



More information about the R-help mailing list