The function estimate the phylogenetic signal at metacommunity level and draws a representation curve.
pcps.curve(
comm,
phylodist,
trait,
checkdata = TRUE,
method = "bray",
squareroot = TRUE,
ranks = TRUE,
null.model.ts = FALSE,
null.model.bm = FALSE,
tree,
runs = 99,
progressbar = FALSE,
parallel = NULL
)pcpc.curve.calc(values, vectors, mt)
# S3 method for pcpscurve
plot(
x,
draw.model = c("none", "ts", "bm"),
type = "b",
probs = c(0.025, 0.975),
col = "black",
model.col = "black",
...
)
# S3 method for pcpscurve
print(x, ...)
# S3 method for pcpscurve
summary(object, probs = c(0.025, 0.975), ...)
Community data, with species as columns and sampling units as rows. This matrix can contain either presence/absence or abundance data. Alternatively comm can be an object of class metacommunity.data, an alternative way to set all data.frames/matrices. When you use the class metacommunity.data the arguments trait and phylodist must not be specified. See details.
Matrix containing phylogenetic distances between species.
Matrix data of species described by traits, with traits as columns and species as rows.
Logical argument (TRUE or FALSE) to check if species sequence in the community data follows the same order as the one in the trait and in the phylodist matrices (Default checkdata = TRUE).
Dissimilarity index, as accepted by vegdist
(Default dist = "bray").
Logical argument (TRUE or FALSE) to specify if use square root of dissimilarity index (Default squareroot = TRUE).
Logical argument (TRUE or FALSE) to specify if ordinal variables are convert to ranks (Default ranks = TRUE).
Logical argument (TRUE or FALSE) to specify if use null model that shuffles terminal tips across the phylogenetic tree to generate null curves. See details (Default null.model.ts = FALSE).
Logical argument (TRUE or FALSE) to specify if use null model that simulate trait evolving under Brownian motion to generate null curves. See details (Default null.model.bm = FALSE).
Phylogenetic tree, as phylo object.
Number of randomizations.
Logical argument (TRUE or FALSE) to specify if display a progress bar on the R console (Default progressbar = FALSE).
Number of parallel processes or a predefined socket cluster done with parallel package. Tip: use detectCores() (Default parallel = NULL).
The eigenvalues, relative eigenvalues and cumulative relative eigenvalues returned by pcps
.
The principal coordinates of phylogenetic structure returned by pcps
.
Matrix containing trait average at community level for one trait.
An object of class pcpscurve.
Type of null model to draw; none (none), taxa shuffle (ts), browian motion model (bm).
Type of the plot to be drawn (Default type = "b").
Numeric vector of probabilities used by quantile
. (Default probs = c(0.025, 0.975)).
Plot color.
Color of lines of null models.
Further graphical parameters for points.
An object of class pcpscurve.
The cumulative PCPS eigenvalues and the coefficient of determination.
The cumulative PCPS eigenvalues and the coefficient of determination for each randomization using the taxa shuffle null model.
The cumulative PCPS eigenvalues and the coefficient of determination for each randomization using the Brownian motion null model.
The sequence species show up in the community data matrix must be the
same as they show up in the phylogenetic distance matrix and in traits
matrix. The function organize.pcps
organizes the data, placing the matrices of
community and phylogenetic distance and trait in the same order. The function use of function
organize.pcps is not requered for run the functions, but is recommended. In this way
the arguments comm and phylodist can be specified them as normal arguments or by passing
them with the object returned by the function organize.pcps
using, in this
case only the argument comm. Using the object returned by organize.pcps, the comm argument
is used as an alternative way of entering to set all data.frames/matrices, and therefore
the arguments phylodist and trait must not be specified.
The PCPS are used, in a sequential manner, as predictors in a linear regression to model the trait averages across the metacommunity. The curve is drawn as the percentage of cumulative eigenvalues in the abscissa and as the determination coefficient of regressions in the ordinate.
Two null models are available. The first one (ts), the null curves are generated shuffling terminal tips across the phylogenetic tree, generates a set of random PCPS and recalculates the curves. The second (bm), the null curves are generated with simulate traits evolving under Brownian motion model.
Duarte, L.S. (2011). Phylogenetic habitat filtering influences forest nucleation in grasslands. Oikos, 120, 208:215.
# NOT RUN {
# }
# NOT RUN {
data(flona)
res<-pcps.curve(flona$community, flona$phylo, flona$trait[,1,drop = FALSE],
null.model.ts = TRUE, runs = 9)
res
summary(res)
plot(res, draw.model = "ts", type = "b", col = "red")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab