Learn R Programming

rmngb (version 0.6-1)

colClasses: Column Classes in a Dataframe

Description

Returns a vector of basic classes of the colums of a dataframe.

Usage

colClasses(x)

Arguments

x
a dataframe.

Value

A named vector of the same length as ncol(x) and whose names equal names(x).

Details

Since the return value is a vector with one element per colunm, column with multiple classes (such as ordered and factor) see their classes simplified as the last class from the class vector.

See Also

class.

Examples

Run this code
tab <- data.frame(a = 1, b = "e", c = gl(1, 1), stringsAsFactors = FALSE)
colClasses(tab)

Run the code above in your browser using DataLab