Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions R/read_swissdata_meta.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ read_swissdata_meta <- function(path, locale = "de", as_list = FALSE) {
# Now this is some serious R-Fu
labels <- expand.grid(lapply(meta_labels, sapply, `[[`, locale), stringsAsFactors = FALSE, KEEP.OUT.ATTRS = FALSE)

if(all(sapply(labels, sapply, is.null) == TRUE)) {
if(as_list) {
out <- lapply(keys, function(x) { NULL })
names(out) <- keys
return(out)
} else {
return(data.table(ts_key = keys))
}
}

# Work some dark magic to get units into it?

# Is this smert? dimnames could be any old crazy strings
Expand Down