StcsvToSchema: Build an object of class StfwfSchema from a csv file.

Description Usage Arguments Value Examples

View source: R/StcsvToSchema.R

Description

StcsvToSchema is a constructor of the class StfwfSchema.

This constructor reads a csv file containing partially or totally the schema of the fixed-width file to read. So far, only English names are supported. This file must contain the following columns:

The file may have a header or not. In the latter case, the order of columns is assumed to be that of the list above. English only is supported so far.

Usage

1
StcsvToSchema(csvname, sep = ";", header = TRUE, lang = "en", ...)

Arguments

csvname

Name of the csv file containing the schema.

sep

The separator between columns. Defaults to ';'.

header

Does the first data line contain column names? Defaults to TRUE.

lang

Character vector of length 1 indicating the language for the header in the csv file (English: en – default). So far only English is supported.

...

Extra arguments for fread.

Value

Return an object of class StfwfSchema.

Examples

1
2
path <- system.file('extdata', package = 'fastReadfwf')
StcsvToSchema(file.path(path, 'SchemaSNHS_microdataWeb.csv'), header = TRUE)

david-salgado/fastReadfwf documentation built on Dec. 25, 2021, 12:43 p.m.