readr_cols: Easy readr column specification

Description Usage Arguments Details Value Examples

Description

Shortcut-loaded convenience wrapper around cols.

Usage

1

Arguments

...

All arguments are passed to readr::cols with any character values first treated and processed as shortcuts for equivalent readr functions–i.e., readr::col_*, readr::parse_*. See details for a list of available shortcuts.

Details

The following list of shortcuts can be supplied as character strings in place of readr col_* or parse_* functions:

Value

Column specification

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## readr package must be installed
if (requireNamespace("readr"), quietly = TRUE) {
  ## create column specification
  readr_cols(
    .default = "?",
    id = "chr",
    is_good = "lgl",
    day = "date",
    timestamp = readr::col_datetime(format = "%m-%y-%d %H:%M:%S"),
    count = "integer",
    misc = "_"
  )
}

mkearney/tfse documentation built on July 6, 2019, 3:18 a.m.