Learn R Programming

LSC (version 0.1.5)

LSC-utils: Utilities for LSC class

Description

The "LSC" class lies at the core of this package as it describes spatio-temporal patterns in the data. It is usually an array with the same spatio-temporal resolution as the original dataset.

plot.LSC plots LSC of $(1+1)D$ and $(2+1)D$ systems.

plot_LSC_1plus1D plots LSC for a (1+1)D field.

plot_LSC_2plus1D plots LSC for a (2+1)D field.

plot_LSC_0plus1D plots LSC for a (0+1)D field, i.e., a time series.

Usage

"plot"(x, ...)
plot_LSC_1plus1D(z, col = NULL, lsc.unit = "bits", heights = c(2, 5), widths = c(5, 2))
plot_LSC_2plus1D(z, type = "temporal", time.frames = NULL, zlim = NULL, heights = NULL, lsc.unit = "bits", data = NULL, col = NULL)
plot_LSC_0plus1D(z, col = NULL, lsc.unit = "bits", ...)

Arguments

x
an object of class "LSC"
...
optional arguments passed to plot_LSC_2plus1D or plot_LSC_1plus1D.
widths
passed to layout for dividing the plotting region horizontally. A vector of length 2: image (left) & temporal average (right)
z
an object of class "LSC"
type
a "temporal" or a "spatial" summary plot of LSC
time.frames
a vector of length $\leq 6$ to indicate what frames should be displayed (only for type = "temporal"). If NULL (default) then it chooses them automatically based on valleys and peaks in the spatial average LSC.
zlim
minimum and maximum z values for which colors should be plotted, defaulting to the range of the finite values of z.
lsc.unit
character string (default: "bits") to write next to the color legend
col
colors: either a string decribing a pallette from the RColorBrewer package (see also http://colorbrewer2.org/), or a list of colors (see image for suggestions).
data
(optional) original data to compare to LSC (relevant only for type = "spatial")
heights
passed to layout for dividing the plotting region vertically. If data = NULL a vector of length 2; otherwise a vector of length 3.

See Also

plot.mixed_LICORS, plot_LSC_2plus1D, plot_LSC_1plus1D

Examples

Run this code
## Not run: 
# data(contCA00)
# 
# temp_lsc <- states2LSC(states = contCA00$predictive_states - 
#     min(contCA00$predictive_states) + 1)
# class(temp_lsc) <- c("LSC", "LSC_1plus1D")
# plot_LSC_1plus1D(temp_lsc)
# ## End(Not run)
## Not run: 
# data(contCA00)
# 
# temp_lsc <- states2LSC(states = contCA00$predictive_states - 
#     min(contCA00$predictive_states) + 1)
# temp_lsc_3D <- array(temp_lsc, dim = c(25, 20, 40))
# class(temp_lsc_3D) <- c("LSC", "LSC_2plus1D")
# plot_LSC_2plus1D(temp_lsc_3D, type = "temporal")
# plot_LSC_2plus1D(temp_lsc_3D, type = "spatial")
# ## End(Not run)
state.sim <- rpois(100, 1)

lsc.est <- states2LSC(states = state.sim)
class(lsc.est) <- c("LSC", "LSC_0plus1D")
plot_LSC_0plus1D(lsc.est)

weights.sim <- matrix(runif(1000, 0, 1), ncol = 10)
weights.sim <- normalize(weights.sim)
lsc.est <- states2LSC(weight.matrix = weights.sim)
plot_LSC_0plus1D(lsc.est)

Run the code above in your browser using DataLab