datatype_to_type: Map csvw datatypes to R types

View source: R/csvwr_overrides.R

datatype_to_typeR Documentation

Map csvw datatypes to R types

Description

Translate csvw datatypes to R types. This implementation currently targets readr::cols column specifications.

Usage

datatype_to_type(datatypes)

Arguments

datatypes

a list of csvw datatypes

Details

rcldf adds some overrides here to add e.g. anyURI etc.

Value

a readr::cols specification - a list of collectors

Examples

## Not run: 
cspec <- datatype_to_type(list("double", list(base="date", format="yyyy-MM-dd")))
readr::read_csv(readr::readr_example("challenge.csv"), col_types=cspec)

## End(Not run)

SimonGreenhill/rcldf documentation built on Dec. 7, 2024, 7:33 p.m.