View source: R/zoo_vector_to_matrix.R
zoo_vector_to_matrix | R Documentation |
Transforms vector coredata of univariate zoo time series to class matrix. If the input zoo time series has the attribute "name", the output inherits the value of such attribute.
Multivariate zoo objects are returned without changes.
zoo_vector_to_matrix(x = NULL, name = NULL)
x |
(required, zoo object) zoo time series. Default: NULL |
name |
(required, character string) name of the matrix column. Default: NULL |
zoo time series
Other zoo_functions:
zoo_aggregate()
,
zoo_name_clean()
,
zoo_name_get()
,
zoo_name_set()
,
zoo_permute()
,
zoo_plot()
,
zoo_resample()
,
zoo_smooth_exponential()
,
zoo_smooth_window()
,
zoo_time()
,
zoo_to_tsl()
#create zoo object from vector
x <- zoo::zoo(
x = runif(100)
)
#coredata is not a matrix
is.matrix(zoo::coredata(x))
#convert to matrix
y <- zoo_vector_to_matrix(
x = x
)
#coredata is now a matrix
is.matrix(zoo::coredata(y))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.