[R] Help in using PCR

Bjørn-Helge Mevik b.h.mevik at usit.uio.no
Wed Jul 2 10:32:22 CEST 2008


Gavin Simpson <gavin.simpson at ucl.ac.uk> writes:

> Ok, lets sort this out. [Not tested as I don't have your data]
>
> df <- data.frame(resp = cancerv1[, 408], 
>                  VARS = as.matrix(cancerv1[, 2:407])

Actually, you _do_ need an I() here:

df <- data.frame(resp = cancerv1[, 408], 
                 VARS = I(as.matrix(cancerv1[, 2:407])))

otherwise data.frame() will split the matrix into single coloumn variables.

-- 
Bjørn-Helge Mevik



More information about the R-help mailing list