attribute_class: Get class type for all columns in a data frame or tibble

Description Usage Arguments Value Examples

View source: R/extradplyr.R

Description

get the class for each column in data, as a named character vector

Usage

1
attribute_class(data, .checkAssertions = TRUE)

Arguments

data

a data frame or tibble type object

.checkAssertions

private variable used to check function assertions (if first in chain)

Value

a character vector of the class type of each column

Examples

1
2
3
4
5
6
7
chr.ex <- sample(c('a','b','c'), 100, TRUE)
int.ex <- sample(c(1,2,3), 100, TRUE)
dttm.ex <- sample(as.Date.character(paste('2020-01-', 1:30, sep='')), 100, TRUE)
sample.data <- data.frame('chr'=chr.ex, 'int'=int.ex, 'dttm'=dttm.ex)

# get data classes for all columns
attribute_class(sample.data)

duncankmckinnon/OKdplyr documentation built on Nov. 30, 2020, 1:13 a.m.