Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.48 KB

README.md

File metadata and controls

57 lines (40 loc) · 1.48 KB

ecocom

Travis build status R build status

The goal of ecocom is to provide tools to compute plant-plant interactions and moments of trait distribution.

Installation

You can install the development version of ecocom from GitHub with:

# install.packages("devtools")
devtools::install_github("alaindanet/ecocom")

Example

This is a basic example which shows you how to solve a common problem:

Compute moments of a trait distribution

library(ecocom)
## basic example code

#vector of species abundance
abun <- rpois(n = 10, lambda = 3)
# vector of species trait
trait <- rnorm(n = 10, mean = 10, sd = 3)

# Compute the moments of trait distribution
calc_cw_moments(trait = trait, weight = abun)
#>       mean   variance   skewness   kurtosis 
#> 10.6483773 23.0843062  0.0672937  2.9857581

Compute plant-plant interaction index

The n_int_a and n_int_c compute the neighbor-effect respectively with additive and commutative symmetry according to Diaz-Sierra et al. (2016).

n_int_a(without = 0, with_nbs = 1)
#> [1] 2