Description Usage Arguments Details Value Examples
View source: R/interpolated_data.R
Get interpolated time series data by tag name
1 2 3 4 5 6 7 8 9 10 | tm_ts_interpolated_data(
token,
tag_name,
start_date,
end_date,
step = 1,
type = "linear",
shift = 0,
...
)
|
token |
A valid access token |
tag_name |
Tag name |
start_date |
POSIXct object with timezone set to "UTC". Start date of the time series |
end_date |
POSIXct object with timezone set to "UTC". End date of the time series |
step |
Time increment between returned observations expressed in seconds |
type |
Interpolation type which is either "linear" or "stepped" |
shift |
Time series shift (offset) expressed in seconds |
... |
Additional arguments passed on to the underlying HTTP method.
This might be necessary if you need to set some curl options explicitly
via |
The maximum number of points tm_ts_interpolated_data()
can return is 10.000.
The step
argument defines the time increment between returned observations.
If you define step
to be one second which is the default setting, the time interval
you can select using the start
and end
arguments can span 2 hours, 46 minutes
and 40 seconds (2 x 60 x 60 + 46 x 60 + 40 = 10.000) at most. Make sure to decrease the
resolution by increasing the step
argument if you like to fetch cohesive time series
data of a tag which spans more than 10.000 seconds.
The shift
argument lets you control if tm_ts_interpolated_data
returns values
which are either forward or backward shifted in time before they are aligned
with the actual time in the response. shift
is expressed in seconds.
The example in the following table shows the returned time series values based
on different shift
settings:
Time | shift = 0 | shift = 1 | shift = -1 |
03:02:00 | 23 | NA | 27 |
03:02:01 | 27 | 23 | 25 |
03:02:02 | 25 | 27 | NA |
A list with two elements:
tag
: A list with tag information and three elements:
tagName
: Length one character vector. tag_name
of the original request
shift
: Length one integer vector. shift
of the original request
interpolationType
: Length one character vector. interpolation_type
of the original request
timeSeries
: A data frame with time series data:
index
: POSIXct vector. Time index of each observation
value
: Double vector. Value of each observation
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.