Last data update: 2014.03.03

R: Curve of phylogenetic signal at metacommunity level
pcps.curveR Documentation

Curve of phylogenetic signal at metacommunity level

Description

The function estimate the phylogenetic signal at metacommunity level and draws a representation curve.

Usage

pcps.curve(comm, dist.spp, trait, method = "bray", squareroot = TRUE,
  null.model.ts = FALSE, null.model.bm = FALSE, tree, runs = 99,
  progressbar = FALSE)

## S3 method for class 'pcpscurve'
plot(x, type = "b", draw.model = c("none", "ts", "bm"),
  probs = c(0.025, 0.975), col = "black", model.col = "black", ...)

## S3 method for class 'pcpscurve'
print(x, ...)

## S3 method for class 'pcpscurve'
summary(object, probs = c(0.025, 0.975), ...)

Arguments

comm

Community data, with species as columns and sampling units as rows. This matrix can contain either presence/absence or abundance data.

dist.spp

Matrix containing phylogenetic distances between species.

trait

Matrix data of species described by traits, with traits as columns and species as rows.

method

Dissimilarity index, as accepted by vegdist (Default dist = "bray").

squareroot

Logical argument (TRUE or FALSE) to specify if use square root of dissimilarity index (Default squareroot = TRUE).

null.model.ts

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).

null.model.bm

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).

tree

Phylogenetic tree, as phylo object.

runs

Number of randomizations.

progressbar

Logical argument (TRUE or FALSE) to specify if display a progress bar on the R console (Default progressbar = FALSE).

x

An object of class pcpscurve.

type

Type of the plot to be drawn (Default type = "b").

draw.model

Type of null model to draw; none (none), taxa shuffle (ts), browian motion model (bm).

probs

Numeric vector of probabilities used by quantile. (Default probs = c(0.025, 0.975)).

col

Plot color.

model.col

Color of lines of null models.

...

Further graphical parameters for points.

object

An object of class pcpscurve.

Details

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.

Value

curve.obs

The cumulative PCPS eigenvalues and the coefficient of determination.

curve.null.ts

The cumulative PCPS eigenvalues and the coefficient of determination for each randomization using the taxa shuffle null model.

curve.null.bm

The cumulative PCPS eigenvalues and the coefficient of determination for each randomization using the Brownian motion null model.

Author(s)

Vanderlei Julio Debastiani <vanderleidebastiani@yahoo.com.br>

References

Duarte, L.S. (2011). Phylogenetic habitat filtering influences forest nucleation in grasslands. Oikos, 120, 208:215.

See Also

matrix.p, pcps

Examples


data(flona)
res_curve<-pcps.curve(flona$community, flona$phylo, flona$trait[,1], method = "bray",
       squareroot = TRUE, null.model.ts = TRUE, runs = 9, progressbar = FALSE)
res_curve
summary(res_curve)
plot(res_curve, type = "b", draw.model = "ts", col = "red")

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(PCPS)
Loading required package: SYNCSA
Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.4-0
Loading required package: mice
Loading required package: Rcpp
mice 2.25 2015-11-09
Loading required package: FD
Loading required package: ade4

Attaching package: 'ade4'

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

    cca

Loading required package: ape
Loading required package: geometry
Loading required package: magic
Loading required package: abind
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/PCPS/pcps.curve.Rd_%03d_medium.png", width=480, height=480)
> ### Name: pcps.curve
> ### Title: Curve of phylogenetic signal at metacommunity level
> ### Aliases: pcps.curve plot.pcpscurve print.pcpscurve summary.pcpscurve
> ### Keywords: PCPS
> 
> ### ** Examples
> 
> 
> data(flona)
> res_curve<-pcps.curve(flona$community, flona$phylo, flona$trait[,1], method = "bray",
+        squareroot = TRUE, null.model.ts = TRUE, runs = 9, progressbar = FALSE)
> res_curve
Call:
pcps.curve(comm = flona$community, dist.spp = flona$phylo, trait = flona$trait[,      1], method = "bray", squareroot = TRUE, null.model.ts = TRUE,      runs = 9, progressbar = FALSE) 

PCPS curve observed:
   Cumulative_PCPS_eigenvalues Coefficient_of_determination
1                    0.2557465                    0.1113260
2                    0.4129037                    0.1259213
3                    0.5071091                    0.1353438
4                    0.5884556                    0.2291499
5                    0.6594012                    0.3269205
6                    0.6942656                    0.3599666
7                    0.7273727                    0.3752064
8                    0.7588776                    0.4118123
9                    0.7824164                    0.4152911
10                   0.8024272                    0.4187222
11                   0.8206126                    0.4250911
12                   0.8359881                    0.5213137
13                   0.8496037                    0.5280361
14                   0.8627556                    0.5344383
15                   0.8746269                    0.5730837
16                   0.8853137                    0.5993158
17                   0.8945924                    0.6032147
18                   0.9036047                    0.6382858
19                   0.9122352                    0.6504338
20                   0.9205221                    0.6515708
21                   0.9280358                    0.6516777
22                   0.9347598                    0.6521618
23                   0.9412647                    0.6577139
24                   0.9476567                    0.6606664
25                   0.9535615                    0.7162135
26                   0.9589457                    0.7164611
27                   0.9639985                    0.7175792
28                   0.9684851                    0.7289763
29                   0.9728933                    0.7327609
30                   0.9770181                    0.7348170
31                   0.9809608                    0.7849290
32                   0.9846486                    0.7866376
33                   0.9879441                    0.8233892
34                   0.9911086                    0.8349374
35                   0.9940973                    0.8657594
36                   0.9969063                    0.8887764
37                   0.9994464                    0.9774276
38                   1.0000000                    1.0000000

Mean PCPS curve null TS:
   Mean_Cum_PCPS_Eig Mean_Coe_Det
1          0.2180745   0.08728877
2          0.3687050   0.14138051
3          0.4602909   0.19898699
4          0.5274520   0.26737258
5          0.5831018   0.30839386
6          0.6277020   0.33602169
7          0.6643232   0.35271271
8          0.6956438   0.37851240
9          0.7240147   0.42677439
10         0.7492409   0.44103113
11         0.7715133   0.45900750
12         0.7912521   0.47934713
13         0.8087621   0.51601110
14         0.8249176   0.53352298
15         0.8395864   0.56464245
16         0.8528675   0.61377085
17         0.8653444   0.62885054
18         0.8766225   0.65379761
19         0.8870905   0.68037423
20         0.8967205   0.71624172
21         0.9059536   0.74638378
22         0.9144252   0.77885810
23         0.9224191   0.79765144
24         0.9299938   0.81677406
25         0.9371599   0.82283036
26         0.9440050   0.83590955
27         0.9504486   0.85541177
28         0.9564200   0.87418817
29         0.9620226   0.88848708
30         0.9673381   0.90462265
31         0.9723569   0.93105918
32         0.9770962   0.94563901
33         0.9815204   0.95662772
34         0.9857622   0.96778196
35         0.9897600   0.98411622
36         0.9935049   0.99229745
37         0.9969591   0.99504402
38         1.0000000   1.00000000
> summary(res_curve)
$call
pcps.curve(comm = flona$community, dist.spp = flona$phylo, trait = flona$trait[, 
    1], method = "bray", squareroot = TRUE, null.model.ts = TRUE, 
    runs = 9, progressbar = FALSE)

$curve.obs
   Cumulative_PCPS_eigenvalues Coefficient_of_determination
1                    0.2557465                    0.1113260
2                    0.4129037                    0.1259213
3                    0.5071091                    0.1353438
4                    0.5884556                    0.2291499
5                    0.6594012                    0.3269205
6                    0.6942656                    0.3599666
7                    0.7273727                    0.3752064
8                    0.7588776                    0.4118123
9                    0.7824164                    0.4152911
10                   0.8024272                    0.4187222
11                   0.8206126                    0.4250911
12                   0.8359881                    0.5213137
13                   0.8496037                    0.5280361
14                   0.8627556                    0.5344383
15                   0.8746269                    0.5730837
16                   0.8853137                    0.5993158
17                   0.8945924                    0.6032147
18                   0.9036047                    0.6382858
19                   0.9122352                    0.6504338
20                   0.9205221                    0.6515708
21                   0.9280358                    0.6516777
22                   0.9347598                    0.6521618
23                   0.9412647                    0.6577139
24                   0.9476567                    0.6606664
25                   0.9535615                    0.7162135
26                   0.9589457                    0.7164611
27                   0.9639985                    0.7175792
28                   0.9684851                    0.7289763
29                   0.9728933                    0.7327609
30                   0.9770181                    0.7348170
31                   0.9809608                    0.7849290
32                   0.9846486                    0.7866376
33                   0.9879441                    0.8233892
34                   0.9911086                    0.8349374
35                   0.9940973                    0.8657594
36                   0.9969063                    0.8887764
37                   0.9994464                    0.9774276
38                   1.0000000                    1.0000000

$null.model.ts
   Mean_Cum_PCPS_Eig Mean_Coe_Det 0.025%_Conf_Cum_PCPS_Eig
1          0.2180745   0.08728877                0.1874859
2          0.3687050   0.14138051                0.3472476
3          0.4602909   0.19898699                0.4323712
4          0.5274520   0.26737258                0.5064965
5          0.5831018   0.30839386                0.5620217
6          0.6277020   0.33602169                0.6042057
7          0.6643232   0.35271271                0.6420361
8          0.6956438   0.37851240                0.6754492
9          0.7240147   0.42677439                0.7058253
10         0.7492409   0.44103113                0.7355275
11         0.7715133   0.45900750                0.7588735
12         0.7912521   0.47934713                0.7795985
13         0.8087621   0.51601110                0.7977161
14         0.8249176   0.53352298                0.8142788
15         0.8395864   0.56464245                0.8291151
16         0.8528675   0.61377085                0.8424121
17         0.8653444   0.62885054                0.8553485
18         0.8766225   0.65379761                0.8669961
19         0.8870905   0.68037423                0.8779467
20         0.8967205   0.71624172                0.8884282
21         0.9059536   0.74638378                0.8980502
22         0.9144252   0.77885810                0.9072937
23         0.9224191   0.79765144                0.9158735
24         0.9299938   0.81677406                0.9239615
25         0.9371599   0.82283036                0.9315414
26         0.9440050   0.83590955                0.9388767
27         0.9504486   0.85541177                0.9459931
28         0.9564200   0.87418817                0.9525108
29         0.9620226   0.88848708                0.9585012
30         0.9673381   0.90462265                0.9642837
31         0.9723569   0.93105918                0.9695779
32         0.9770962   0.94563901                0.9746260
33         0.9815204   0.95662772                0.9794423
34         0.9857622   0.96778196                0.9840425
35         0.9897600   0.98411622                0.9883807
36         0.9935049   0.99229745                0.9925177
37         0.9969591   0.99504402                0.9964656
38         1.0000000   1.00000000                1.0000000
   0.975%_Conf_Cum_PCPS_Eig 0.025%_Conf_Coe_Det 0.975%_Conf_Coe_Det
1                 0.2445301         0.004573197           0.3516679
2                 0.3956941         0.022150593           0.3893231
3                 0.4931700         0.046124679           0.4231015
4                 0.5514194         0.112809683           0.4602678
5                 0.6048480         0.168958330           0.4703939
6                 0.6432293         0.204569244           0.4709012
7                 0.6772531         0.221717695           0.5072023
8                 0.7088860         0.244328779           0.5226140
9                 0.7379008         0.303579428           0.5369336
10                0.7607521         0.306116983           0.5487010
11                0.7823173         0.347648490           0.5904172
12                0.8011736         0.352584215           0.6249053
13                0.8180731         0.402305196           0.6503074
14                0.8338982         0.408374666           0.6863593
15                0.8482380         0.458892002           0.7148560
16                0.8610351         0.514509142           0.7588240
17                0.8727775         0.514991249           0.7686097
18                0.8841131         0.541210147           0.8053901
19                0.8940957         0.551922149           0.8465281
20                0.9036776         0.574182257           0.8519535
21                0.9129402         0.644589522           0.8615696
22                0.9212498         0.709595682           0.8684782
23                0.9289477         0.734689743           0.8851802
24                0.9359187         0.761397707           0.8942344
25                0.9425495         0.766717065           0.8989171
26                0.9488823         0.773851004           0.9176303
27                0.9549611         0.780846124           0.9209580
28                0.9605029         0.804506528           0.9395450
29                0.9657725         0.817551048           0.9399421
30                0.9705603         0.827951115           0.9513702
31                0.9751927         0.888586050           0.9701501
32                0.9796697         0.898802196           0.9796483
33                0.9835191         0.909794184           0.9944040
34                0.9872924         0.933620533           0.9962396
35                0.9909974         0.960174156           0.9983049
36                0.9942861         0.982801423           0.9984809
37                0.9974100         0.983600637           0.9999910
38                1.0000000         1.000000000           1.0000000

> plot(res_curve, type = "b", draw.model = "ts", col = "red")
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>