knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" ) options(cli.unicode = FALSE)
fit and compare Species-Area Relationship (SAR) models using multi-model inference
sars provides functionality to fit twenty SAR model using non-linear regression, and to calculate multi-model averaged curves using various information criteria. The software also provides easy to use functionality to plot multi-model SAR curves and to generate confidence intervals using bootstrapping. Additional SAR related functions include fitting the linear version of the power model and comparing parameters with the non-linear version, fitting the general dynamic model of island biogeography, fitting the random placement model to a species abundance-site matrix, and extrapolating fitted SAR models to predict richness on larger islands / sample areas. Version 1.3.0 has added functions for fitting, evaluating and plotting a range of commonly used piecewise SAR models (see @Matthews2020 for details on these functions).
Please report any bugs or issues to us via GitHub.
The package has an associated vignette that provides examples of how to use the package, and an accompanying paper [@Matthews2019].
A website for the package can be found here: https://txm676.github.io/sars/
Version 1.1.1 of the package has been archived on the Zenodo research data repository (DOI: 10.5281/zenodo.2573067).
You can install the released version of sars from CRAN with:
install.packages("sars")
And the development version from GitHub with:
# install.packages("devtools") devtools::install_github("txm676/sars")
Basic usage of sars will result in using two types of functions:
library(sars)
To fit the power sar model [@Arrhenius1921] to the 'galapagos' [@Preston1962] data set:
fit_pow <- sar_power(data = galap) fit_pow
Attempting to fit all 20 sar models to the 'galapagos' [@Preston1962] data set and get a multi-model SAR:
mm_galap <- sar_average(data = galap)
Each of the 'fitted' objects have corresponding plot methods:
To fit the logarithmic SAR model [@Gleason1922] to the 'galapagos' data set and plot it
fit_loga <- sar_loga(data = galap) plot(fit_loga)
To fit a multimodel SAR curve to the 'galapagos' data set and plot it (alongside the individual model fits)
mm_galap <- suppressMessages(sar_average(data = galap, verb = FALSE)) mm_galap plot(mm_galap, pLeg = FALSE, mmSep = TRUE)
To fit the two-threshold continuous model to the 'aegean2' dataset
fit <- sar_threshold(data = aegean2, mod = c("ContTwo"), interval = 0.1, non_th_models = FALSE, logAxes = "area", con = 1, logT = log10, nisl = NULL) plot(fit, cex = 0.8, cex.main = 1.1, cex.lab = 1.1, pcol = "grey") #Figure 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.