[R] row.names are dropped when extracting one column ?

ryszard.czerminski@pharma.novartis.com ryszard.czerminski at pharma.novartis.com
Tue Mar 2 18:59:47 CET 2004


Apparently row names are dropped when I extract
single column from a data frame. Why this behaviour ?

> y <- as.matrix(df[,1:2]); length(row.names(y))
[1] 324
> y <- as.matrix(df[,1:1]); length(row.names(y))
[1] 0

Best regards,

Ryszard




More information about the R-help mailing list