R/api_get_timeseries.R
api_get_timeseries.RdThis function calls postgres_get to get data from the endpoint
given by path and calls fhpredict:::flatten_recursive_list to
convert the list structure into a data frame. The time columns "createdAt"
and "updatedAt" are converted from a text timestamp given in ISO 8601 format
(e.g. "2019-10-22T23:38:29.003Z") to POSIXct objects in time zone
"Europe/Berlin". A new POSIXct column dateTime is created from the
original text columns date and dateTime as they are returned by
the API:
(original) date column: date and time information as text,
e.g. "2019-09-21T00:00:00.000Z"
(original) dateTime column: only time information as text,
e.g. "10:50:00"
(new) dateTime column: date and time as POSIXct in time zone
"Europe/Berlin"
api_get_timeseries(path, subject = "timeseries", sort = TRUE, token = NULL, type = NULL)
| path | (relative) path to API endpoint |
|---|---|
| subject | name of data subject, to be used in messages |
| sort | if |
| token | passed to |
| type | optional. If given, columns are removed and reordered using
|