readRawHDSS: Read raw HDSS data

Description Usage Arguments Details Value See Also Examples

Description

Read one or several data files, or a whole directory of data files, as provided by the INDEPTH project, into R.

Usage

1
2
readRawHDSS(file, path, zipped = FALSE, verb = TRUE, forceList = FALSE,
  ...)

Arguments

file

A file name or a vector of filenames to be read; if missing, all files with the specified extension in the specified directory will be read.

path

The directory from which to read the data files

zipped

A logical flag, indicating whether to read from zipped files or from unzipped files (i.e. .csv files with the same basename).

verb

A logical flag, indicating whether to report during reading

forceList

A logical flag indicating whether to return a list, see Details

...

Extra arguments, passed to read.csv

Details

The data files are assumed to be CSV text files with standard coulmn names as outlined in the HDSS specifications, see Examples below. Alternatively, the data files can also be zipped versions of such a CSV file. In this case, it is assumed that the name of the zipped file (without path) is the same as the name of the zipped file, but with extension .zip instead of .csv. It is no possible to mix zipped and unzipped files in the same function call.

Note that by default, this function returns a data frame if one file is found and a list of data frames if to or more files are found. Use argument forceList if consistent behavior is required.

Value

If only one filename is specified and forceList is FALSE, a single data frame. If multiple filenames are specified or implied (by specifying only the path to the data), a list of data frames, each containing the raw data of one of the specified files; the names of the list entries are the basenames (without extensions) of the files read in.

See Also

coreRecordTests, preprocHDSS

Examples

1
2
3
file = system.file("extdata/testHDSS.csv", package="R.HDSS")
test1 = readRawHDSS(file)
head(test1)

alexploner/R.HDSS documentation built on May 12, 2019, 2:32 a.m.