Description Usage Arguments Value Author(s) Examples

Performs permutation tests by permuting upper level labels between lower levels, recalculating upper trait value, and taking the correlation between upper level trait and survivorship. This process is repeated until a null distribution is generated. This is then compared against observed covariance to give a p value for the null hypothesis that a relationship between trait and survivorship is explainable by random aggregations of lower level traits.

1 | ```
perspectev.test(data,iterations=1000,cores=1,traitfun=mcpRange,vlist=NULL,na.rm=FALSE)
``` |

`data` |
Dataframe in perspectev format (see ?perspectev.read). |

`iterations` |
Number of iterations to perform. At least 1000 is recommended, though can be slow. |

`cores` |
Number of cores over which to parallelize the test. |

`traitfun` |
Function for calculating trait values at each level. |

`vlist` |
Optional variable list for trait function. |

`na.rm` |
Remove NA values from trait functions? Shouldn't need to be used if trim=TRUE from perspectev.read. |

`correlation_permuted` |
Correlations between trait and survivorship obtained from permuted upper levels (Si) |

`correlation_observed` |
Observed correlation between upper level trait and survivorship (Ri) |

`pvalue` |
Portion of permuted genus correlations (S) larger than observed value (R) |

`permuted_quantiles` |
Matrix of interquartile trait values obtained from each upper level permutation |

Kenneth B. Hoehn <perspectev@gmail.com>

1 2 3 4 5 6 7 8 9 | ```
data(testData)
data = perspectev.read(testData,extinctionAge=5,occurrenceAge="Age",
upper="Genus",lower="Species",traits=c("Lat","Long"),traitfun=mcpRange,projection=FALSE)
#4 iterations chosen out of convenience - use more!
mcpTest = perspectev.test(data,4,1,traitfun=mcpRange)
mcpSim = perspectev.simulate(data,4,1,traitfun=mcpRange)
perspectev.plot(mcpTest,list(mcpSim),c("S1"),"Test")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.