Description Usage Arguments Details Value See Also Examples
Read one or several data files, or a whole directory of data files, as provided by the INDEPTH project, into R.
1 2 |
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. |
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 |
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.
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.
1 2 3 | file = system.file("extdata/testHDSS.csv", package="R.HDSS")
test1 = readRawHDSS(file)
head(test1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.