| plot.tf | R Documentation |
base plots for tfsSome base functions for displaying functional data in
spaghetti- (i.e., line plots) and lasagna- (i.e., heat map) flavors.
## S3 method for class 'tf'
plot(
x,
y,
n_grid = 50,
points = is_irreg(x),
type = c("spaghetti", "lasagna"),
alpha = min(1, max(0.05, 2/length(x))),
...
)
## S3 method for class 'tf'
lines(x, arg, n_grid = 50, alpha = min(1, max(0.05, 2/length(x))), ...)
## S3 method for class 'tf'
points(
x,
arg,
n_grid = NA,
alpha = min(1, max(0.05, 2/length(x))),
interpolate = FALSE,
...
)
x |
an |
y |
(optional) numeric vector to be used as |
n_grid |
minimal size of equidistant grid used for plotting,
defaults to |
points |
should the original evaluation points be marked by points?
Defaults to |
type |
|
alpha |
alpha-value (see |
... |
additional arguments for |
arg |
evaluation grid (vector). |
interpolate |
should functions be evaluated (i.e., inter-/extrapolated)
for arg for which no original data is available? Only relevant for
tfd, defaults to |
If no second argument y is given, evaluation points (arg) for the functions
are given by the union of the tf's arg and an equidistant grid
over its domain with n_grid points. If you want to only see the original
data for tfd-objects without inter-/extrapolation, use n_grid < 1 or
n_grid = NA.
the plotted tf-object, invisibly.
Swihart, J B, Caffo, Brian, James, D B, Strand, Matthew, Schwartz, S B, Punjabi, M N (2010). “Lasagna plots: a saucy alternative to spaghetti plots.” Epidemiology (Cambridge, Mass.), 21(5), 621–625.
f <- tfd(sin(seq(0, 2 * pi, length.out = 51)), arg = seq(0, 1, length.out = 51))
plot(f)
plot(c(f, 2 * f), type = "lasagna")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.