column_class: Returns all columns and classes matching specified class

Description Usage Arguments Examples

View source: R/column_class.R

Description

The column_class function takes two arguments, x, a data.frame object, and find_class, a single or vector of character value(s) of the class type desired.

Usage

1
column_class(df = NULL, find_class = NULL)

Arguments

df

data.frame; a data.frame with named columns

find_class

string or string vector; a single or vector of string value(s) of column class types

Examples

1
2
3
4
5
6
7
8
x <- data.frame(
  col_a = as.factor(c("a", "b", "c"))
  , col_b = as.integer(c(1, 2, 3))
  , col_c = as.factor(c("apple", "banana", "citrus"))
  , col_d = as.character(c("one", "two", "three"))
)
column_class(x, "factor")
column_class(x, c("integer", "character"))

mike-decarlo/caser documentation built on Sept. 23, 2019, 7:15 a.m.