0

I am interested in generating an average species accumulation curve (# fish species per minute of survey) across multiple surveys.

I understand how specaccum() (vegan) is generally used to look at the accumulation of species as more sites are sampled.

This particular sample design is investigating how species accumulate over time when using a survey tool (video camera surveying fish). The idea is that the longer a camera soaks in the water - the more fish species should be observed swimming by. I have then repeated this process multiple times, and so have ended up with several tables akin to the BCI data set with each row being a minute of time.

A single 15 minute trial might look like:

library(vegan)

counts = c(0,0,0,0,0,
       0,0,0,0,0,
       1,2,3,4,5)



#Survey over 15 minutes
fish = data.frame(Time = seq(1,15,1),
              S.mys = sample(counts,15,replace = T),
              S.ros = sample(counts,15,replace = T),
              S.pau = sample(counts,15,replace = T),
              S.ens = sample(counts,15,replace = T),
              S.con = sample(counts,15,replace = T),
              S.sax = sample(counts,15,replace = T),
              S.sim = sample(counts,15,replace = T))

#taken from the help file example:
sp1 = specaccum(fish)
sp2 = specaccum(fish, 'random')
plot(sp1, ci.type = 'poly',col = 'blue',lwd = 2, ci.lty = 0, ci.col = 'lightblue')
boxplot(sp2,add = T, col = 'peachpuff')

Now if I have performed multiple trials, (several 15 minute time periods) is there a way to average the species accumulation results?

Kodiakflds
  • 603
  • 1
  • 4
  • 15
  • 1
    Would `rowMeans(cbind(sp1$richness, sp2$richness))` be something you're looking for? – Jari Oksanen Nov 04 '17 at 10:56
  • Hi @JariOksanen, I believe this (along with your other helpful comment below) have both answered both the coding and theoretical components of my question – Kodiakflds Nov 08 '17 at 22:16

1 Answers1

1

If you want to get the average per study you can put all study data into one data.frame and aggregate itre like this using data.table.

require(data.table)
fish<-cbind(fish,Study=rep(1,15))   #Add study column
setDT(fish)                         #Add class data.table
fish[, lapply(.SD, mean), by=Study] #Aggregate data by study and take mean

   Study Time    S.mys S.ros    S.pau     S.ens S.con     S.sax
1:     1    8 1.266667   0.8 1.666667 0.2666667   1.6 0.6666667
      S.sim 
1: 1.133333 
CCurtis
  • 1,770
  • 3
  • 15
  • 25
  • Thank you @CCurtis , I think this is a great start. I'm still figuring out if this is the approach I should take to calculate one average species accumulation curve based on several surveys - or whether individual curves should be calculated then averaged post-hoc. At any rate, I need to work on learning the apply functions – Kodiakflds Nov 03 '17 at 21:57
  • 1
    If you average, you accumulate. That means: averages have **more** species than single observations. If species accumulation is to have any sense, it must be made on simple observations and then the curves can be averaged. – Jari Oksanen Nov 04 '17 at 19:12