MoBiodiv / mobsim

Spatial analysis and simulation of ecological communities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

code for generating function times

dmcglinn opened this issue · comments

nperm = 20
S = c(1e1, 1e2, 1e3)
N = c(1e3, 1e4, 1e5)
times = array(NA, dim = c(length(S), length(N)))
dimnames(times) = list(S, N)

for(i in seq_along(S)) {
    for(j in seq_along(N)) {
        times[i, j] = system.time(replicate(nperm, spec_sample_curve(
            sim_thomas_community(S[i], N[j], 'lnorm'), method='rarefaction')))[1] / nperm
    }
}

The above averages over 20 runs (nperm value) for a given S and N value. Probably its a good idea to test this for a different pattern as well.

Hey thanks for you work on the package!
I just saw this issue and wanted to recommend the great {bench} package with the function press.