Description Usage Arguments Value Examples
View source: R/StxlsxToSchema.R
XLSToSchema
is a constructor of the class StfwfSchema.
This constructor reads an Excel file containing partially or totally the schema of the
fixed-width file to read. This file must contain a tag with name Schema
(en) or
DiseñoRegistro
(sp) and the following named columns:
variable
(en, sp): the name of the variable.
width
(en) or anchura
(sp): the number of positions which the values of
this variable occupies in the file.
initialPos
(en) or posInicial
(sp): initial position of the field which
the values of this variable occupies in the file.
finalPos
(en) or posFinal
(sp): final position of the field which the
values of this variable occupies in the file.
type
(en) or tipo
(sp): type of the variable. It must be either log
,
integer
, num
or char
.
valueRegEx
(en) or regExValor
(sp): regular expression for the values of
this variable.
description
: textual description of the variable.
The tag must have a header in file 1. Only English is supported so far.
1 | StxlsxToSchema(xlsxName, sheetToRead, header = TRUE, lang = "en", ...)
|
xlsxName |
Name of the xlsx file containing the schema. |
sheetToRead |
Name or index of the sheet of the xlsx file. |
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 xlsx file (English: en). |
... |
Extra arguments for |
Return an object of class StfwfSchema.
1 2 | path <- system.file('extdata', package = 'fastReadfwf')
StxlsxToSchema(file.path(path, 'SchemaSNHS.xlsx'), 'stSchema')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.