Learn R Programming

readr (version 1.1.1)

cols: Create column specification

Description

Create column specification

Usage

cols(..., .default = col_guess())

cols_only(...)

Arguments

...

Either column objects created by col_*(), or their abbreviated character names. If you're only overriding a few columns, it's best to refer to columns by name. If not named, the column types must match the column names exactly.

.default

Any named columns not explicitly overridden in ... will be read with this column type.

Examples

Run this code
# NOT RUN {
cols(a = col_integer())
cols_only(a = col_integer())

# You can also use the standard abreviations
cols(a = "i")
cols(a = "i", b = "d", c = "_")
# }

Run the code above in your browser using DataLab