read_smn_multiple | R Documentation |
One peculiarity of MeteoSwiss is to provide multiple exports concatenated in one file, starting with a line
containing a single space and seperated by two newlines. This function reads the whole file into the memory, splits
the part and applies the read function to each part. Is the file too big for the available memory, the function
split_smn()
can split the file into multiple files each containing one part. On Linux the commandline tool csplit
is another probably faster tool.
read_smn_multiple(fn, as_list = FALSE, encoding = "UTF-8", ...)
fn |
path to input file |
as_list |
return a list with each part as element rather than one concatenated tibble |
encoding |
encoding of the data file. Default = "UTF-8" |
... |
parameters passed to |
tibble or list of tibbles in rOstluft long format structure
read_smn()
split_smn()
csplit - split a file into sections determined by context lines
fn <- system.file("extdata", "smn_multi.txt", package = "rOstluft.data", mustWork = TRUE)
read_smn_multiple(fn, as_list = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.