Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


dtables (version 0.2.0)

dvariable: Data.frame of Variables and Classes

Description

Helper function for dtable. Returns information about each variable's class, mode, type, and number of response levels in a data.frame, or list if as.list = TRUE.

Usage

dvariable(data1, vars = NULL, as.list = FALSE)

Arguments

data1
a data.frame
vars
specify one or more variable names with a character vector
as.list
logical, TRUE returns a list split by class

Value

Returns a data.frame or list with the variable names and their respective classes. Returns a data.frame by default.

See Also

class to examine method for extracting class.

mode to examine method for extracting mode.

typeof to examine method for extracting type.

Examples

Run this code
# Describe all variables in iris2
dvariable(iris2)

# Describe one or more specific variables in iris2
dvariable(iris2, vars = "Species")

# Return variable and class data in list
dvariable(iris2, as.list = TRUE)

Run the code above in your browser using DataLab