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

datatype_to_type(datatypes)

Arguments

datatypes

a list of csvw datatypes

Value

a readr::cols specification - a list of collectors

Examples

if (FALSE) {
cspec <- datatype_to_type(list("double", list(base="date", format="yyyy-MM-dd")))
readr::read_csv(readr::readr_example("challenge.csv"), col_types=cspec)
}