Read a time series file (CSV/TSV) with a date + one or more value columns
Source:R/fund_imp.R
read_timeseries.RdLoads a delimited file from the directory specified by fundsr.data_dir,
converts the date column to a proper Date, and coerces all other columns to
numeric.
Usage
read_timeseries(file, time_unit = c("ms", "s", "us", "ns"))Details
The reader is chosen by file extension: .csv uses readr::read_csv() and
.tsv/.tab/.txt uses readr::read_tsv(). Gzipped variants such as
.csv.gz and .tsv.gz are also supported.
The function assumes a column named date exists and represents a Unix
timestamp. All non-date columns are coerced with as.numeric() (non-parsable
values become NA).