Displaying 1 result from an estimated 1 matches for "variablesus".
Did you mean:
variables
2006 Aug 18
5
as.data.frame(cbind()) transforming numeric to factor?
Dear List,
why does as.data.frame(cbind()) transform numeric variables to
factors, once one of the other variablesused is a character vector?
#
x.1 <- rnorm(10)
x.2 <- c(rep("Test",10))
Foo <- as.data.frame(cbind(x.1))
is.factor(Foo$x.1)
Foo <- as.data.frame(cbind(x.1,x.2))
is.factor(Foo$x.1)
#
I assume there is a good reason for this, can somebody explain? Thanks.
Best,
Tom