Description Usage Arguments Value Examples
View source: R/StcsvToSchema.R
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:
variable
: the name of the variable.
width
: the number of positions which the values of each
variable occupies in the file.
initialPos
: initial position of the field which the values of
this variable occupies in the file.
finalPos
: final position of the field which the values of
this variable occupies in the file.
type
: type of the variable. It must be either log
,
int
, num
or char
.
valueRegEx
: regular expression (regex) for the values
of each variable.
description
: textual description of the variable.
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.
1 | StcsvToSchema(csvname, sep = ";", header = TRUE, lang = "en", ...)
|
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
|
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 |
Return an object of class StfwfSchema.
1 2 | path <- system.file('extdata', package = 'fastReadfwf')
StcsvToSchema(file.path(path, 'SchemaSNHS_microdataWeb.csv'), header = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.