assign_class: Extract class of variable
Description
Some packages append non-base classes to data frame columns, e.g.
if data is labeled with the Hmisc
package the class of a string will
be c("labelled", "character")
rather than c("character")
only. This
simple function extracts the base R class.
Usage
assign_class(data, variable)
Arguments
variable
string vector of column names from data