plot.smw: Plot the dissimilarity profiles

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Plot.R

Description

Plot results from smw and dp objects. The command is a shortcut for extracting and plotting SMW resuts. Auxiliary arguments from extract (i.e. sig, z, BPs and seq.sig) can be passed to plot.smw. The auxilary method bgDP is available for the returned dp object when the argument bg is not NULL (see Details).

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'smw'
plot(x, w = NULL, sig = "z", z = 1.85, BPs = "max",
  seq.sig = 3, w.effect = F, values = c("zscore", "diss"),
  pchs = c(16, 16, 17), cols = c("black", "red", "blue"), bg = NULL,
  bg_alpha = 0.1, wcols = "rainbow", legend = TRUE, ...)

## S3 method for class 'dp'
bgDP(dp)

Arguments

x

An object of class "smw" resulted from the function SMW.

w

The window size from which results will be plotted. Only effective if length(smw)>1.

sig

Significance test for detecting dissimilarity values that differs significantly from those appearing in a random pattern. If NULL the significance test is ommited from the plot.The following tests are considered with default to sig.test="z":

  • 'z' consider normalized dissimilarity (z-scores) discontinuities that exceed a "z" critical value;

  • 'sd' consider dissimilarity discontinuities that exceed mean plus one standard deviation;

  • 'SD2' consider dissimilarity discontinuities that exceed mean plus two standard deviation;

  • 'tail1' Consider dissimilarity discontinuities that exceed 95 percent confidence limits.

z

The critical value for the significance of z-values. Defaults to 'z=1.85' (Erdös et.al, 2014).

BPs

Defines if the breakpoints should be chosen as those sample positions corresponding to the maximum dissimilarity in a sequence of significant values ("max") or as those sample positions corresponding to the median position of the sequence ("median"). Defaults to BPs="max". If NULL the breakpoints are not computed.

seq.sig

The maximum length of consecutive, significant values of dissimilarity that will be considered in defining the community breakpoints. Defaults to seq.sig=3;

w.effect

Logical, if TRUE draws a dissimilarity profile using different windows sizes and returns an invisible data.frame with the breakpoint frequencies. Only effective if length(smw)>1. The function uses extract with defaults parameters to define the breakpoint positions for each of the evaluated window sizes.

values

Character. "zscore" for plotting z-scores, "diss" for plotting dissimilarity values.

pchs

A numerical vector of the form c(d,s,b) which modifies the default symbols of the plot. The default pch = c(16,16,17) describes respectively the dissimilarity values, significant dissimilarity values and breakpoints.

cols

Vector of length 3 specifying the colors of the plot in the same way as the pch argument. Defaults to colors=c("black","red","blue").

bg

Optional. Sets background colors according to the breakpoints. It can be expressed either by a vector of colors or by the name of a pallet function (e.g. "rainbow").

bg_alpha

Factor modifying the opacity alpha of the backgroud [0,1].

wcols

Sets the colors for the window sizes (lines) when w.effect=TRUE. It can be expressed by a vector of colors or by the name of a pallet function. Defaults to wcol="rainbow" which uses the colour palette rainbow from R stats.

legend

Logical. Should a default legend appear?

...

Further graphical parameters.

dp

An object of class dp.

Details

If bg is not NULL, the attribute params$bg is added to the returned dp. This attribute contains the sample colors used by the argument bg. The auxilary method bgDP can be used for accessing this color vector.

Value

The function returns invisibly an object of class "dp" (see Details).

Author(s)

Danilo Candido Vieira

See Also

SMW, extract.

Examples

1
2
3
4
5
6
7
8
data(sim1)
sim1o<-OrdData(sim1$envi,sim1$comm)


ws20<-SMW(yo=sim1o$yo,ws=20)
pool<-SMW(yo=sim1o$yo,ws=c(20,30,40))
plot(ws20)
plot(pool, w.effect=TRUE)

segRDA documentation built on July 31, 2019, 9:03 a.m.