Version: | 1.0.2 |
Date: | 2019-07-06 |
Title: | Modeling Non-Continuous Linear Responses of Ecological Data |
Author: | Danilo C Vieira <vieiradc@yahoo.com.br>, Gustavo Fonseca <gfonseca.unifesp@gmail.com>, and Fabio Cop Ferreira <fabiocferreira.unifesp@gmail.com>, with contributions from Marco Colossi Brustolin. |
Maintainer: | Danilo C Vieira <vieiradc@yahoo.com.br> |
Description: | Tools for modeling non-continuous linear responses of ecological communities to environmental data. The package is straightforward through three steps: (1) data ordering (function OrdData()), (2) split-moving-window analysis (function SMW()) and (3) piecewise redundancy analysis (function pwRDA()). Relevant references include Cornelius and Reynolds (1991) <doi:10.2307/1941559> and Legendre and Legendre (2012, ISBN: 9780444538697). |
Depends: | R (≥ 2.15), vegan (≥ 2.4) |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 6.1.1 |
Suggests: | knitr, rmarkdown, testthat |
VignetteBuilder: | knitr |
URL: | https://github.com/DaniloCVieira/segRDA |
BugReports: | https://github.com/DaniloCVieira/segRDA/issues |
License: | MIT + file LICENSE |
NeedsCompilation: | no |
Packaged: | 2019-07-26 20:06:34 UTC; Danilo |
Repository: | CRAN |
Date/Publication: | 2019-07-31 07:30:02 UTC |
segRDA: Modeling Non-Continuous Linear Responses of Ecological Data
Description
Tools for modeling non-continuous linear responses of ecological communities to environmental data. The package is straightforward through three steps: (1) data ordering (function OrdData()), (2) split-moving-window analysis (function SMW()) and (3) piecewise redundancy analysis (function pwRDA()). Relevant references include Cornelius and Reynolds (1991) <doi:10.2307/1941559> and Legendre and Legendre (2012, ISBN: 9780444538697).
See Also
Useful links:
Report bugs at https://github.com/DaniloCVieira/segRDA/issues
Data ordering
Description
Ordinates both community and explanatory matrices based on the first RDA score.
Usage
OrdData(x, y, axis = 1, method = NA, ...)
Arguments
x |
explanatory matrix; |
y |
community matrix; |
axis |
the RDA axis in which the ordering should be based. Defaults to |
method |
standardization method (described in |
... |
furhter parameters passed to |
Value
An object of class "ord"
, which is a list consisting of:
xo: the ordered explanatory matrix
yo: the ordered community matrix (non-transformed)
x: the original explanatory matrix
y: the original community matrix
Author(s)
Danilo Candido Vieira
Examples
data(sim1)
sim1.o<-OrdData(x=sim1$envi, y=sim1$comm)
sim1.o<-OrdData(x=sim1$envi, y=sim1$comm, method="hellinger")
Split moving window analysis
Description
Function SMW
performs split moving window analysis (SMW) with randomizations tests. It may compute dissimilarities for a single window size or for several windows sizes.
Usage
SMW(yo, ws, dist = "bray", rand = c("shift", "plot"), n.rand = 99)
Arguments
yo |
The ordered community matrix. |
ws |
The window sizes to be analyzed. Either a single value or a vector of values. |
dist |
The dissimilarity index used in vegan:: |
rand |
The type of randomization for significance computation (Erdös et.al, 2014):
|
n.rand |
The number of randomizations. |
Value
A two-level list object (class smw
) describing the SMW results for each window w
analyzed. The smw
object is of length ws
, and each of the w
slots is a list of SMW results:
-
..$dp
: The raw dissimilarity profile (DP). The DP is a data frame giving the positions, labels, values of dissimilarity and z-scores for each sample; -
..$rdp
: data frame containing the randomized DP; -
..$md
: mean dissimilarity of the randomized DP; -
..$sd
: standard deviation for each sample position; -
..$oem
: overall expected mean dissimilarity; -
..$osd
: average standard deviation for the dissimilarities; -
..$params
: list with input arguments
Available methods for class "smw"
are print
, extract
and plot
.
Author(s)
Danilo Candido Vieira
References
Erdos, L., Z. Bátori, C. S. Tölgyesi, and L. Körmöczi. 2014. The moving split window (MSW) analysis in vegetation science - An overview. Applied Ecology and Environmental Research 12:787–805.
Cornelius, J. M., and J. F. Reynolds. 1991. On Determining the Statistical Significance of Discontinuities with Ordered Ecological Data. Ecology 72:2057–2070.
See Also
Examples
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))
Extract results and breakpoints from a smw
object
Description
Functions to extract results and breakpoints from a smw
object
Usage
## S3 method for class 'smw'
extract(smw, w = NULL, index = "dp", sig = "z",
z = 1.85, BPs = "max", seq.sig = 3)
## S3 method for class 'dp'
bp(dp)
Arguments
smw |
An object of class |
w |
Numeric. A "target" window size from which results will be extracted (see Details). Only effective if the |
index |
The result to be extracted:
|
sig |
Significance test for detecting dissimilarity values that differs significantly from those appearing in a random pattern. The following tests are considered with default to
|
z |
The critical value for the significance of z-values. Defaults to |
BPs |
Defines if the breakpoints should be chosen as those sample positions corresponding to the maximum dissimilarity in a sequence of significant values ( |
seq.sig |
The maximum length of consecutive, significant values of dissimilarity that will be considered in defining the community breakpoints. Defaults to |
dp |
An object of class |
Details
If the smw
object contains results from multiple window sizes, the DP table will be based on the average Z-score over the set of analysed window sizes. Available methods for class "dp"
are print
, bp
and plot
.
The argument w
is optional. If the smw
object is length 1, w
is ignored. If length(smw)>1
and w
is NULL
, the function will extract the dissimilarity profile averaged over the set of window sizes.
Value
-
"extract"
returns a result called by the argumentindex
(see Details); -
"bp"
returns the locations of the breakpoints.
See Also
Examples
data(sim1)
sim1o<-OrdData(sim1$envi,sim1$comm)
ws50<-SMW(yo=sim1o$yo,ws=50)
ws50_dp<-extract(ws50)
head(ws50_dp)
Nematodes data from Araca Bay, Sao Sebastiao, Brazil.
Description
A total of 37 sites arranged in an irregular grid were surveyed during four sampling campaigns at the Araçá Bay, southeastern Brazil. A total of 141 samples were collected for analyzing changes in nematodes assemblages along the environmental gradient of the bay.
Usage
data(nema)
Format
nema
is a list with the following components:
- envi
a matrix with 141 sites and 9 environmental variables: chlorophyll a (mg.m-2), bathymetry (meters), percentage of total organic carbon, percentage of coarse sands (as the sum of pebbles, very coarse, coarse, and medium grains), percentage of fine sand, percentage of very fine sand, mean grain size, and sorting coefficient.
- comm
matrix with 141 sites of 194 nematodes species
References
Checon, H. H., D. C. Vieira, G. N. Corte, E. C. P. M. Sousa, G. Fonseca, and A. C. Z. Amaral. 2018. Defining soft bottom habitats and potential indicator species as tools for monitoring coastal systems: A case study in a subtropical bay. Ocean & Coastal Management.
Corte, G. N., H. H. Checon, G. Fonseca, D. C. Vieira, F. Gallucci, M. Di Domenico, and A. C. Z. Amaral. 2017. Cross-taxon congruence in benthic communities: Searching for surrogates in marine sediments. Ecological Indicators 78:173–182.
Plot the dissimilarity profiles
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
## 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 |
w |
The window size from which results will be plotted. Only effective if |
sig |
Significance test for detecting dissimilarity values that differs significantly from those appearing in a random pattern. If
|
z |
The critical value for the significance of z-values. Defaults to |
BPs |
Defines if the breakpoints should be chosen as those sample positions corresponding to the maximum dissimilarity in a sequence of significant values ( |
seq.sig |
The maximum length of consecutive, significant values of dissimilarity that will be considered in defining the community breakpoints. Defaults to |
w.effect |
Logical, if |
values |
Character. |
pchs |
A numerical vector of the form |
cols |
Vector of length 3 specifying the colors of the plot in the same way as the pch argument. Defaults to |
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. |
bg_alpha |
Factor modifying the opacity alpha of the backgroud [0,1]. |
wcols |
Sets the colors for the window sizes (lines) when |
legend |
Logical. Should a default legend appear? |
... |
Further graphical parameters. |
dp |
An object of class |
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
Examples
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)
Piecewise redundancy analysis (pwRDA)
Description
Perform a pwRDA using the specified breakpoints
Usage
pwRDA(x.ord, y.ord, BPs, n.rand = 99)
Arguments
x.ord |
ordered explanatory matrix |
y.ord |
ordered community matrix |
BPs |
community breakpoints |
n.rand |
The number of randomizations for significance computation |
Value
Returns an invisible list of length 4:
-
..$summ
: summary statistics of the pwRDA analysis; -
..$rda.0
: full model cca object, which is described separately in vegan::cca.object
-
..$rda.pw
: pw model cca object, which is described separately in vegan::cca.object
Author(s)
Danilo Candido Vieira
Examples
data(sim1)
sim1o<-OrdData(sim1$envi,sim1$comm)
w50<-SMW(sim1o$yo, ws=50)
sim1.pw<-pwRDA(sim1o$xo,sim1o$yo, BPs=bp(extract(w50)))
Simulated datasets
Description
Simulated datasets for testing segRDA package
Usage
data(sim1)
data(sim2)
data(sim3)
Format
Each data set is a list with the following components:
- envi
environmental matrix
- comm
community matrix