Coder Social home page Coder Social logo

valentinitnelav / bootdissim Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 208 KB

R package for building turnover saturation curves via bootstrapping

License: MIT License

R 100.00%
turnover beta-diversity ecological-network ecological-modelling r ecology pollination resample rarefaction biodiversity conservation

bootdissim's Introduction

bootdissim

DOI

Overview

R package for building turnover saturation (rarefaction or accumulation) curves via bootstrapping. It offers a workflow to bootstrap dissimilarity metrics between ecological networks.

In the case of bipartite networks (e.g. plant - pollinator), such curves are informative about the level of effort still needed for collecting data to the point of having a trusted turnover estimate.

Installation

You can install bootdissim from GitHub with:

# install.packages("devtools")
devtools::install_github("valentinitnelav/bootdissim")

Examples

Given two networks, like vazarr and vazcer from the bipartite package. One can compute the bootstrapped saturation curve of turnover (dissimilarity) between these two networks when looking at their interactions.

library(bootdissim)
library(bipartite)
library(ggplot2)

# Get the character vectors of interactions from each network
net1 <- reshape_net(vazarr, seed = 1)
net2 <- reshape_net(vazcer, seed = 1)
vect <- get_interactions(net1, net2)

# Can also compute the observed dissimilarity between the two vectors of
interactions. Several indices are implemented for now:
abc <- get_abc(vect)

get_beta(abc, "whittaker")
# [1] 0.2846473
get_beta(abc, "jaccard")
# [1] 0.5568475
get_beta(abc, "sorensen")
# [1] 0.7153527

# Bootstrapp (resample) the dissimilarity:
dism_boot <- boot_dissim(lst_vect = vect,
                         index = "whittaker",
                         by = 50,
                         replace = FALSE,
                         size_short = TRUE,
                         n_boot = 100,
                         n_cpu = 3)

# Plot the saturation curve
p <- plot_dissim(get_stats_gg(dism_boot))
p <- p + labs(x = "Number of sampled interactions",
              y = "Total turnover (dissimilarity)") +
  theme_bw()
p

How to cite the package?

Valentin Ștefan, & Tiffany Marie Knight. (2021). bootdissim: R package for building turnover saturation curves via bootstrapping (v1.0.0). Zenodo. https://doi.org/10.5281/zenodo.7145381

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.