Description Usage Arguments Value See Also Examples
Create a "uts_matrix"
from long (also known as narrow) tabular data. Data in this format has four different columns; the observation values, the observation times, the entity name of each observation (e.g. person, country), and the attribute/field name of each observation (e.g. which one of serveral economic indicators, which one of several blood measurement values).
1 | uts_matrix_long(values, times, names = base::names(values), fields)
|
values |
a vector observation values. |
times |
a |
names |
a character vector. The the matching entity names for the observations. By default, the names of |
fields |
a character vector. The the matching attribute/field names for the observations. |
An object of class "uts_matrix"
. The time series in row entity_name
and column field_name
contains all observations of such entity for such field.
The number of rows is given by to the number of distinct entity names (parameter names
), while the number of columns is given by the number of distinct attribute/field names (parameter fields
).
uts_matrix_wide
, uts_vector_long
, uts_vector_wide
1 2 3 4 5 6 7 | values <- c(A=1, A=2, B=3, B=4, A=5)
times <- as.POSIXct("2016-01-01") + dhours(1:5)
uts_matrix_long(values, times, fields=c("c", "d", "d", "d", "d"))
uts_matrix_long(values=1:5, times=as.POSIXct("2015-01-01") + days(1:5),
names=c("A", "A", "B", "B", "A"), fields=c("c", "d", "d", "d", "d"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.