Get data.frame names and types
Arguments
- x
data.frame / data.table or similar
Value
character vector of column names with attribute "type" holding the class of each
column
Examples
getnamesandtypes(iris)
#> [1] "Sepal.Length" "Sepal.Width" "Petal.Length" "Petal.Width" "Species"
#> attr(,"type")
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> "numeric" "numeric" "numeric" "numeric" "factor"