Answers for "r get class of all columns"

R
0

r function to get class of all columns

> foo <- data.frame(c("a", "b"), c(1, 2))
> names(foo) <- c("SomeFactor", "SomeNumeric")
> lapply(foo, class)
$SomeFactor
[1] "factor"

$SomeNumeric
[1] "numeric"
Posted by: Guest on November-11-2020

Code answers related to "r get class of all columns"

Browse Popular Code Answers by Language