R/utils_df.R
getnamesandtypes.Rd
Get data.frame names and types
getnamesandtypes(x)
data.frame / data.table or similar
character vector of column names with attribute "type" holding the class of each column
EDG
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"