Turn a 1D time series vector into a 2D curve
Usage
ts_rasterize(y, unitSquare = FALSE, toSparse = TRUE, resolution = 2)
Arguments
- y
A 1D time series object or numeric vector.
- unitSquare
Convert the series to a unit square? (default = FALSE)
- toSparse
Convert to sparse Matrix (default = FALSE)
- resolution
Factor by which dimensions will be multiplied (default = 2)
Value
A (sparse) matrix representing the time series as a curve in 2D space
See also
Other Time series operations:
ts_center(),
ts_changeindex(),
ts_checkfix(),
ts_detrend(),
ts_diff(),
ts_discrete(),
ts_duration(),
ts_embed(),
ts_integrate(),
ts_levels(),
ts_peaks(),
ts_permtest_block(),
ts_permtest_transmat(),
ts_sd(),
ts_slice(),
ts_slopes(),
ts_standardise(),
ts_sumorder(),
ts_symbolic(),
ts_trimfill(),
ts_windower()
Examples
# \donttest{
y <- rnorm(100)
plot(ts(y))
y_img <- ts_rasterize(y)
image(y_img,col=c("white","black"))# }