col_rep()
allows for a simple specification of column types for use in read
functions. Enter in a letter followed by a number to repeat that type that number
of times.
Supports output for use in readr
and readxl
, and other functions
that take column type specifications in the same format.
col_rep(str, spec_type = "readr")
An expanded string or a vector of column type specifications.
col_rep("c3n2dl3-2c")
#> [1] "cccnndlll--c"
col_rep("c3n2dl3-2c", "readxl")
#> [1] "text" "text" "text" "numeric" "numeric" "numeric" "logical"
#> [8] "logical" "logical" "skip" "skip" "text"