Skip to contents

Get data.frame names and types

Usage

getnamesandtypes(x)

Arguments

x

data.frame / data.table or similar

Value

character vector of column names with attribute "type" holding the class of each column

Author

EDG

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"