Skip to contents

The get_attributes function takes an R object as input and returns its attributes, omitting the row.names attribute.

Usage

get_attributes(.data)

Arguments

.data

An R object from which attributes are to be extracted.

Value

A list of attributes of the input R object, excluding row.names.

Details

This function retrieves the attributes of a given R object, excluding the row.names attribute.

Author

Steven P. Sanderson II, MPH

Examples

get_attributes(rw30())
#> $names
#> [1] "walk_number" "step_number" "y"          
#> 
#> $class
#> [1] "tbl_df"     "tbl"        "data.frame"
#> 
#> $num_walks
#> [1] 30
#> 
#> $num_steps
#> [1] 100
#> 
#> $mu
#> [1] 0
#> 
#> $sd
#> [1] 1
#> 
#> $fns
#> [1] "rw30"
#> 
#> $dimension
#> [1] 1
#> 
get_attributes(iris)
#> $names
#> [1] "Sepal.Length" "Sepal.Width"  "Petal.Length" "Petal.Width"  "Species"     
#> 
#> $class
#> [1] "data.frame"
#> 
get_attributes(mtcars)
#> $names
#>  [1] "mpg"  "cyl"  "disp" "hp"   "drat" "wt"   "qsec" "vs"   "am"   "gear"
#> [11] "carb"
#> 
#> $class
#> [1] "data.frame"
#>