summaryplot: Plot summary of an fdsample object

Description Usage Arguments Details Examples

View source: R/summaryplot.R

Description

Plots the individual functions or a pointwise envelope, as well as a summary function, of function values coerced in an object of class fdsample.

Usage

1
2
summaryplot(x, ..., sumfun = "mean", fopt = list(), envprob = NULL,
  includy = NULL, add = F)

Arguments

x

the fdsample to be plotted

...

further arguments

sumfun

the summary function. If NULL, no summary function is plotted. Defaults to "mean".

fopt

list of options for sumfun.

envprob

coverage of the envelope, defaults to NULL: no envelope is plotted.

includy

optional numeric vector containing values that are to be included in the ylim extent of the y-axis. Can be used to always start at 0, for example.

add

if FALSE (default), a new plot is started, if TRUE, adds to existing plot

Details

This function is a method to the generic summaryplot from package plutils, therefore it is necessary to require(plutils).

Plotting parameters for the individual functions can be given as a simplist (from the plutils package) or separately. If not given explicitely, default values contained in the list x$options are used. If these are set to NULL, the global graphic parameters as reported by par are assumed.

Individual functions are plotted using the parameters

col character or numeric, color,
lwd numeric, line width,
lty character or numeric, line type,
alpha numeric between 0 and 1, alpha value, controls colour opacity / brightness, defaults to 1.

For the summary function, the parameters are

col.sum character or numeric, color, defaulting to col
alpha.sum numeric between 0 and 1, alpha value, defaults to 1,
lwd.sum numeric, line width, defaulting to 2 * lwd,
thus the summary function always plots stronger than the individual curves,
lty.sum character or numeric, line type, defaults to lty.

Plotting of envelopes is controlled by the parameters

col.env character or numeric, color, defaults to col
alpha.env numeric between 0 and 1, alpha value, defaults to Defaults to 0.5*alpha,
thus the envelope will always plot lighter than individual functions.

The summary function given in x is used, if not overridden by the parameter sumfun. By default this is the mean.

To suppress plotting of the summary function or the individual functions, set sumfun = NULL or lwd = 0, respectively.

If envprob is a single number between 0 and 1, a central pointwise envelope covering envprob*100 percent of the function values is plotted. If two numbers are given, they are used to specify the lower and upper quantile used for the envelope. To suppress plotting of an envelope, let envprob = NULL.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
require(plutils)
 # load data, containing an example set "fuda"
data(ExampleData)

# plot mean and median in a minimax envelope

summaryplot(fuda, envprob = 1)
summaryplot(fuda, envprob = NULL, sumfun = median,
          add = TRUE, col = "red", lwd = 0)

# using a predefined list of options,
# summary function will be plotted in black (default)

blau <- simplist(col = "blue", alpha.env = .8, col.smf = "green")
summaryplot(fuda, sumfun = "mean", envprob = .8, blau, alpha = .7)
# adds individual lines, overriding light options contained in fuda and blau

fdnonpar documentation built on May 2, 2019, 5:54 p.m.