Skip to content
Prev 43945 / 398525 Next

data.frame to matrix

On Mon, 9 Feb 2004 17:47:36 -0300, "Gustavo Pinheiro"
<gustavo at estatcamp.com.br> wrote :
I'd guess "as.numeric(tkcurselection(subgroupsBox)) + 1" isn't
returning what you think it's returning, or maybe .numeric isn't in
the form you think.

I'd also recommend using both row and column indices when working with
data frames.  What you have selects columns from a data.frame, but not
from a matrix (assuming that the index is a vector of integers).  I
find it's safer to treat data.frames as matrices whenever you can,
i.e. use a blank row index

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

Duncan Murdoch