[R] data.frame to matrix

Gustavo Pinheiro gustavo at estatcamp.com.br
Mon Feb 9 21:47:36 CET 2004

Hello all,

I've had trouble converting a data.frame to a matrix (numeric) using either
data.matrix() and as.matrix().
After executing one of those I end up with another data.frame with only the
first column of the original data.frame.
I use a window (tcltk) to let the user choose the columns he wants and then
I retrieve them using the following:

varstemp <- .numeric[as.numeric(tkcurselection(subgroupsBox)) + 1]

where ".numeric" is the original (complete) data.frame.

Any ideas why is this happening? I'm using R1.8.1 in WinXP by the way.


More information about the R-help mailing list