Description Usage Arguments Details Value Author(s) Examples
View source: R/EcolUtils_functions.R
Classification of OTU's seasonality based on the sum of their auto-correaltion function and on null community matrices.
1 2 | seasonality.test(comm.tab, n = 1000, probs = c(0.025, 0.975),
lag.max = 120, na.action = na.pass)
|
comm.tab |
Community data, a matrix-like object (samples as rows; OTUs as columns). Samples should be ordered and representing a time series. |
n |
Number of permutations. |
probs |
Probabilities for confidence interval calculations. |
lag.max |
Maximum lag at which to calculate the acf. See the |
Basically the seasonality.test
function computes the auto-correlation function (acf) for each OTU in the comm.tab
through the acf
function in the stats package. The sum of the absolute values of the acf is computed as the seasonality index for each OTU.
This seasonality index and CI for each OTU is also computed for n
null community matrices. The null matrices are created by randomly shuffling the rows in comm.tab
. Each OTU is classified depending whether the real seasonality index is lower / higher / within the CI.
Data frame with the observed seasonality index, the mean and CI null values and the classification of each OTU.
Guillem Salazar <guillems@ethz.ch>
1 2 3 4 5 6 7 | library(RCurl)
# It runs but makes no ecological sense as data does not represent a time-series
x<-getURL("https://raw.githubusercontent.com/GuillemSalazar/MolEcol_2015/master/OTUtable_Salazar_etal_2015_Molecol.txt")
comm.tab<-read.table(text=x,sep="\t",row.names=1,header=TRUE,comment.char="@")
comm.tab<-t(comm.tab[,1:60])
comm.tab<-comm.tab[,which(colSums(comm.tab)>0)]
res<-seasonality.test(comm.tab,n=10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.