plot.irregFunData: Plotting irregular functional data

Description Usage Arguments See Also Examples

View source: R/plotMethods.R

Description

This function plots observations of irregular functional data on their domain.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
plot.irregFunData(
  x,
  y,
  obs = seq_len(nObs(x)),
  type = "b",
  pch = 20,
  col = grDevices::rainbow(length(obs)),
  xlab = "argvals",
  ylab = "",
  xlim = range(x@argvals[obs]),
  ylim = range(x@X[obs]),
  log = "",
  add = FALSE,
  ...
)

## S4 method for signature 'irregFunData,missing'
plot(x, y, ...)

Arguments

x

An object of class irregFunData.

y

Missing.

obs

A vector of numerics giving the observations to plot. Defaults to all observations in x.

type

The type of plot. Defaults to "b" (line and point plot). See plot for details.

pch

The point type. Defaults to 20 (solid small circles). See par for details.

col

The color of the functions. Defaults to the rainbow palette.

xlab, ylab

The titles for x- and y-axis. Defaults to "argvals" for the x-axis and no title for the y-axis. See plot for details.

xlim, ylim

The limits for x- and y-axis. Defaults to the total range of the data that is to plot. See plot for details.

log

A character string, specifying the axis that is to be logarithmic. Can be "" (non-logarithmic axis, the default), "x", "y", "xy" or "yx". See plot.default for details. This parameter is ignored, if add = TRUE.

add

Logical. If TRUE, add to current plot (only for one-dimensional functions). Defaults to FALSE.

...

Additional arguments to plot.

See Also

plot.funData, irregFunData, plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
oldpar <- par(no.readonly = TRUE)

# Generate data
argvals <- seq(0,2*pi,0.01)
ind <- replicate(5, sort(sample(1:length(argvals), sample(5:10,1))))
object <- irregFunData(argvals = lapply(ind, function(i){argvals[i]}),
                  X = lapply(ind, function(i){sample(1:10,1) / 10 * argvals[i]^2}))

plot(object, main = "Irregular functional data")

par(oldpar)

Example output

Attaching package: 'funData'

The following object is masked from 'package:stats':

    integrate

funData documentation built on Oct. 17, 2021, 5:06 p.m.