uts_vector_wide: Create uts_vector from wide tabular data

Description Usage Arguments Value See Also Examples

View source: R/wide_long.R

Description

Create a "uts_vector" from wide tabular data (see Wikipedia). For data in this format, values in the same row are measurements at the same time point, either across multiple entities (e.g. persons, countries) or of multiple attributes (e.g. several economic indicators, blood work results). Values in the same column are measurements of the same entity or attribute over time.

Usage

1
uts_vector_wide(values, times, names = colnames(values))

Arguments

values

a matrix or data.frame. Each row is a vector of observations at a specific time point.

times

a POSIXct object. The observation times of the rows of values.

names

a character vector. The entity/attribute names of the columns of values. By default, the column names of values are used.

Value

An object of class "uts_vector". The number of time series is equal to the number of columns of values. The length of each time series is equal to the number of rows of values.

See Also

uts_vector_long, uts_matrix_long, uts_matrix_wide

Examples

1
2
3
values <- data.frame(apples=1:10, oranges=letters[1:10],
  bananas=month.name[1:10], stringsAsFactors=FALSE)
uts_vector_wide(values, times=as.POSIXct("2015-01-01") + ddays(1:10))

andreas50/utsMultivariate documentation built on Sept. 27, 2021, 10:33 p.m.