read_header_genesis {wiesbaden} | R Documentation |
Read Header of a GENESIS csv
Description
read_header_genesis
reads the header of a GENESIS csv.
Usage
read_header_genesis(
...,
start,
lines = 2,
readr_locale = locale(encoding = "windows-1252"),
replacer = NULL,
clean_letters = TRUE
)
Arguments
... |
arguments to |
start |
number of the first line of the header |
lines |
number of header lines |
readr_locale |
definition of locale() to be passed to read_csv2() |
replacer |
a vector that is used as the first K column-names |
clean_letters |
make proper variable names? (default: TRUE) |
locale |
default encoding is 'windows-1252' |
Details
To generate valid column names, the function replaces all special characters (e.g. German öüä) with ASCII letters and removes whitespaces. Multi-line headers are joined but separated with a '_'.
Value
a vector
of column names.
See Also
Examples
## Not run:
library(readr)
download_csv(tablename="12411-0004")
d <- read_header_genesis('12411-0004.csv', start=6, replacer=c("STAG"))
data <- read_csv2('12411-0004.csv', skip=6, n_max=30-6+1,
na="-", locale=locale(encoding="windows-1252") )
colnames(data) <- d
## End(Not run)
[Package wiesbaden version 1.2.10 Index]