col_rep: Simple column specifications

View source: R/read_functions.R

col_repR Documentation

Simple column specifications

Description

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.

Usage

col_rep(str, spec_type = "readr")

Arguments

str

String specifying the expansion.

spec_type

String. Either "readr" for short letter notation (e.g., ccnnndcc) or "readxl" for long vector notation (e.g., c("text", "text", "numeric"))

Value

An expanded string or a vector of column type specifications.

Examples

col_rep("c3n2dl3-2c")

col_rep("c3n2dl3-2c", "readxl")


Technomics/costmisc documentation built on Nov. 12, 2024, 8:05 a.m.