Learn R Programming

mudata2 (version 1.1.3)

as_col_spec: Describe column types for use in the columns table

Description

Type descriptions are basically calls to readr::col_* or readr::parse_*, and can contain arguments for the sake of completeness (but this shouldn't normally be necessary).

Usage

as_col_spec(type_str)

as_parser(type_str)

parse_type(type_str)

Value

A parsed version of the type_str, a column specification or parsing function

Arguments

type_str

A type string, one of date, datetime, logical, double, character, guess, time, integer, wkt, or json.

Examples

Run this code
# mostly type specs are just type names
# parse_type("character")
# as_col_spec("character")
# as_parser("character")

# can also pass arguments if needed
# parse_type("datetime(format='%m%.%d%.%Y')")
# as_col_spec("datetime(format='%m%.%d%.%Y')")
# as_parser("datetime(format='%m%.%d%.%Y')")

Run the code above in your browser using DataLab