Displaying 1 result from an estimated 1 matches for "fourlogicals".
2006 Nov 03
1
man page for as.matrix for data frames outdated?
...t any non-numeric/complex column into a character vector
using 'format' and so return a character matrix, except that
all-logical data frames will be coerced to a logical matrix.
It's true that "all-logical data frames will be coerced to a logical
matrix":
> fourLogicals <- 2:5>3
> df1 <- data.frame(a=fourLogicals)
> storage.mode(as.matrix(df1))
[1] "logical"
Otherwise it's not true that 'as.matrix' will return a character matrix:
> fourInts <- 2:-1
> df2 <- data.frame(a=fourLogicals, b=fourInts...