Skip to content
Prev 43607 / 398513 Next

creating a factor

Hallo
On 3 Feb 2004 at 20:43, Simon Hosking wrote:

            
your.f <- factor(rep(c(1,2),c(7,3)))
your.frame<-cbind(your.f,your.matrix)

with your numbers ordered into 10x2 matrix like

cbind(factor(rep(c(1,2),c(7,3))),matrix(rnorm(20),10,2))
or
data.frame(var.f=factor(rep(c(1,2),c(7,3))),matrix(rnorm(20),10,2))
Did you really follow examples from "An Introduction to R" manual?
Cheers Petr
Petr Pikal
petr.pikal at precheza.cz