-
Notifications
You must be signed in to change notification settings - Fork 1
/
README.Rmd
62 lines (44 loc) · 1.58 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# ecocom
<!-- badges: start -->
[![Travis build status](https://travis-ci.com/alaindanet/ecocom.svg?branch=master)](https://travis-ci.com/alaindanet/ecocom)
[![R build status](https://github.com/alaindanet/ecocom/workflows/R-CMD-check/badge.svg)](https://github.com/alaindanet/ecocom/actions)
<!-- badges: end -->
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](https://github.com/) with:
``` r
# 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
```{r example}
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)
```
### 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)](https://besjournals.onlinelibrary.wiley.com/doi/full/10.1111/2041-210X.12706).
```{r pp-int}
n_int_a(without = 0, with_nbs = 1)
```