Turn a 1D time series vector into a 2D curve

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

Examples


# \donttest{
y <- rnorm(100)
plot(ts(y))


y_img <- ts_rasterize(y)
image(y_img,col=c("white","black"))# }