Skip to contents

Reading a delimited file – the format that declares nothing, and therefore the one with the most to say.

One constructor per format: each takes exactly the settings its format has, so an argument from another format is rejected by R as unused, and each format's own enums and defaults can be documented against the class they belong to.

Usage

setup_DelimitedIngest(
  columns = NULL,
  character2factor = TRUE,
  clean_colnames = TRUE,
  remove_duplicates = FALSE,
  reader = "data.table",
  sep = NULL,
  quote = "\"",
  na_strings = ""
)

Arguments

columns

Optional Named vector: Declared column types, keyed by column name, in the profile/r/v1 vocabulary – c(Age = "integer"). A column named here is converted to that type after reading, so a known type takes precedence over the reader's inference.

character2factor

Logical: If TRUE, read character columns as factors.

clean_colnames

Logical: If TRUE, normalize column names.

remove_duplicates

Logical: If TRUE, drop rows repeating an earlier row.

reader

Character {"data.table", "vroom", "duckdb", "arrow"}: Library used to read the file.

sep

Optional Character: Field separator. If NULL, the reader detects it.

quote

Character: Quote character.

na_strings

Character vector: Strings to read as missing.

Value

DelimitedIngestConfig object.

Author

EDG

Examples

setup_DelimitedIngest(sep = ";")
#> <DelimitedIngestConfig>
#> 
#>              format: <chr> delimited
#>             columns: <NUL> NULL
#>    character2factor: <lgc> TRUE
#>      clean_colnames: <lgc> TRUE
#>   remove_duplicates: <lgc> FALSE
#>              reader: <chr> data.table
#>                 sep: <chr> ;
#>               quote: <chr> "
#>          na_strings: <chr> 
#>