as.data.frame.uts_vector: Coerce to a Data Frame

Description Usage Arguments Note See Also Examples

Description

Flatten a uts_vector to a data.frame.

Usage

1
2
## S3 method for class 'uts_vector'
as.data.frame(x, ..., method = "wide")

Arguments

x

a "uts_vector" object.

...

further arguments passed to or from methods.

method

either "long" or "wide", determining the shape of the output:

  • "long": a data.frame with one row for each observation for each time series in x. The data.frame has three columns denoting the source of each observation (i.e. from which time series of x is the observation from?), the observation time, and the observation value.

  • "wide": a data.frame with one column for each time series in x.

Note

Only time series with atomic observation values can be coerced to a data.frame.

This method is helpful for saving a multivariate time series to a human-readable text file.

See Also

The uts_vector_long and uts_vector_wide constructors provide the opposite funcitonality, i.e. they convert data in long and wide format, respectively, to a uts_vector.

Examples

1
2

andreas50/utsMultivariate documentation built on May 12, 2019, 10:31 p.m.