colClasses: Column Classes in a Dataframe

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/utils.R

Description

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

Usage

1

Arguments

x

a dataframe.

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.

Value

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

Author(s)

Antoine Filipovic Pierucci

See Also

class.

Examples

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

Example output

          a           b           c 
  "numeric" "character"    "factor" 

rmngb documentation built on May 29, 2017, 9:22 p.m.

Related to colClasses in rmngb...