read_ts_tables | R Documentation |
Read time-series data from files and merge them.
read_ts_tables(file, dir, t.type = "guess", start, end, columns, return.class = NULL, drop.weekends = FALSE, column.names = "%dir%/%file%::%column%", backend = "csv", read.fn = NULL, frequency = "1 sec", timestamp)
file |
character |
dir |
character |
t.type |
character: |
start |
a timestamp: either of classes It is best to always specify |
end |
a timestamp: either of classes It is best to always specify |
columns |
character. |
return.class |
|
drop.weekends |
logical |
column.names |
character: a format string for column names; may
contain |
backend |
character: currently, only ‘ |
read.fn |
|
frequency |
character; used compute a regular grid between
|
timestamp |
a vector of timestamps: if specified, only data at
the times in |
Read time-series data from CSV files.
When return.class
is NULL
, a list:
data |
a numeric matrix |
timestamp |
Date or POSIXct |
columns |
character |
file.path |
character |
Otherwise an object of class as specified by argument
return.class
.
Enrico Schumann
write_ts_table
t1 <- ts_table(1:3, as.Date("2018-12-3") + 1:3, columns = "A") t2 <- ts_table(4:5, as.Date("2018-12-3") + 1:2, columns = "A") d <- tempdir() ## this is just an example. ## Actual (valuable) data should never ## be stored in a tempdir! write_ts_table(t1, dir = d, file = "t1") write_ts_table(t2, dir = d, file = "t2") read_ts_tables(c("t1", "t2"), dir = d, columns = "A", return.class = "zoo", column.names = "%file%.%column%")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.