ReadRepoFile: Read a file with a key-value pair structure.

Description Usage Arguments Value See Also Examples

View source: R/ReadRepoFile.R

Description

ReadRepoFile returns an StQ (default) or a rawStQ object with the content of the file corresponding to the input name.

Usage

1
2
3
4
5
6
7
8
9
ReadRepoFile(
  FileName,
  DD,
  out = "StQ",
  perl = FALSE,
  sep = "@@",
  encoding = "unknown",
  verbose = TRUE
)

Arguments

FileName

Character vector of length 1 with the name of the file to read. The file will be read from the working directory (see getwd) unless the full path is specified.

DD

Object of class DD with the definition and characteristics of the data contained in the file to read.

out

Character vector of length 1 indicating whether to output an StQ object (out = 'StQ'; default) or a rawStQ object (out = 'rawStQ').

perl

Logical vector of length 1 indicating whether Perl is installed in the system or not.

sep

Character vector of length 1 containing the combination of characters used as separator in the input file (default value @).

encoding

Character vector of length 1 with default value is "unknown". Other possible options are "UTF-8" and "Latin-1". Note: it is not used to re-encode the input, rather enables handling of encoded strings in their native encoding.

verbose

Logical vector of length 1 indicating whether report timings are shown or not.

Value

Return an object of class StQ or class rawStQ with all data from the input file.

See Also

WriteRepoFile

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
#We assume that the key-value ASCII file \code{E30183.FF_V1.MM032014.D_1} is in the administrator 
desktop (change accordingly otherwise): 
ExcelName <- 'T:/E30163/E30163.NombresVariables_V1.xlsx'
DD <- RepoXLSToDD(ExcelName)
RepoName <- 'T:/E30163/E30163.FF_V1.MM032014.D_1'
Example.StQ <- ReadRepoFile(RepoName, DD, perl = TRUE)
str(Example.StQ)

## End(Not run)

david-salgado/RepoReadWrite documentation built on Oct. 3, 2021, 1:09 p.m.