forked from academicpages/academicpages.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
108 lines (108 loc) · 4.44 KB
/
.Rhistory
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
## <span style="color:#9e0142">**Personal pages**</span>
<a href="https://paimpont.univ-rennes1.fr/" target="_blank">Biological Station of Paimpont</a>
<a href="https://paimpont.univ-rennes1.fr/" target="_blank">Biological Station of Paimpont</a>
<a href="https://paimpont.univ-rennes1.fr/" target="_blank">Biological Station of Paimpont</a>
[Céline Bellard](https://celinebellard.wordpress.com/)
[Elsa Bonnaud](https://elsabonnaud.fr/)
[Franck Courchamp](https://www.biodiversitydynamics.fr/)
[Boris Leroy](http://borisleroy.com/)
[Adeline Loyau](http://www.adeline-loyau.net/)
[David Renault](https://www.iufrance.fr/les-membres-de-liuf/membre/1660-david-renault.html)
[Dirk S. Schmeller](http://dirk.die-schmellers.de/Publications/publications_new.htm)
[Arnaud Sentis](https://arnaudsentis.com/)
[Sébastien Villéger](http://villeger.sebastien.free.fr/)
install.packages("hyperref")
https://img.shields.io/endpoint?color=b2182b&label=essai&style=plastic&url=https%3A%2F%2Fpaimpont.univ-rennes1.fr%2F
## install.packages("devtools")
devtools::install_github("GuangchuangYu/badger")
library(devtools)
install.packages("devtools")
devtools::install_github("GuangchuangYu/badger")
library(viridis)
viridis(4)
library(viridis)
viridis(5)
?setwd
library("spatstat")
library("VGAM")
n <- 100 # number of row and columns in the grid
# For instance assuming an overdispersed model. Using Poisson-lognormal distribution.
X <- rpolono(n , meanlog =-1, sdlog = 1) # generating random number from Poisson-lognormal distribution
# If your model is not overdispersed then replace the above line with X <- rpois(n, lambda=1) for example or use another distribution.
par(mfrow=c(sqrt(n),sqrt(n)),mar = c(0,0,0,0),oma = c(0,0,0,0), mai = c(0,0,0,0))
for(i in 1:n){
pp <- runifpoint(X[i])
plot(pp, main="")
}
install.packages("spatstat")
install.packages("VGAM")
library("spatstat")
library("VGAM")
n <- 100 # number of row and columns in the grid
# For instance assuming an overdispersed model. Using Poisson-lognormal distribution.
X <- rpolono(n , meanlog =-1, sdlog = 1) # generating random number from Poisson-lognormal distribution
# If your model is not overdispersed then replace the above line with X <- rpois(n, lambda=1) for example or use another distribution.
par(mfrow=c(sqrt(n),sqrt(n)),mar = c(0,0,0,0),oma = c(0,0,0,0), mai = c(0,0,0,0))
for(i in 1:n){
pp <- runifpoint(X[i])
plot(pp, main="")
}
X
rpolono(n , meanlog =-1, sdlog = 1)
##----------------
##LOADING PACKAGES
##----------------
library(igraph)
##-----------------
##LOADING FUNCTIONS
##-----------------
source("Functions_for_null_model.R")
##------------
##METAWEB DATA
##------------
# For this example, the metaweb object is an adjacency matrix of 100 species, with a connetance 0.05
# This metaweb is composed by 50% of phytoplancton, 25% zooplancton, 20% of invertebrates, and 5% of fish
spp.names <- c(paste0("P",seq(1,100*0.50,length.out = 100*0.50)),
paste0("Z",seq(1,100*0.25,length.out = 100*0.25)),
paste0("I",seq(1,100*0.20,length.out = 100*0.20)),
paste0("F",seq(1,100*0.05,length.out = 100*0.05)))
metaweb <-matrix(rbinom(100*100, size = 1, prob = 0.05), nrow = 100, ncol = 100, dimnames = list(spp.names, spp.names))
View(metaweb)
L <- 203
S <- 29
randomweb <- generate.random (S, L)
install.packages("foodweb")
library(foodweb)
L <- 203
S <- 29
randomweb <- generate.random (S, L)
install.packages("foodweb", repos="http://R-Forge.R-project.org")
install.packages("foodweb", repos = "http://R-Forge.R-project.org")
L <- 203
S <- 29
randomweb <- generate.random (S, L)
?rbinom
##----------------
##LOADING PACKAGES
##----------------
library(igraph)
##-----------------
##LOADING FUNCTIONS
##-----------------
source("Functions_for_null_model.R")
##------------
##METAWEB DATA
##------------
# For this example, the metaweb object is an adjacency matrix of 100 species, with a connetance 0.05
# This metaweb is composed by 50% of phytoplancton, 25% zooplancton, 20% of invertebrates, and 5% of fish
spp.names <- c(paste0("F",seq(1,100*0.05,length.out = 100*0.05)),
paste0("I",seq(1,100*0.20,length.out = 100*0.20)),
paste0("Z",seq(1,100*0.25,length.out = 100*0.25)),
paste0("P",seq(1,100*0.50,length.out = 100*0.50))
)
metaweb <- matrix(rbinom(100*100, size = 1, prob = 0.05), nrow = 100, ncol = 100, dimnames = list(spp.names, spp.names))
View(metaweb)
matrix(sample(0:1, 10*100, replace=TRUE),10, 100)
paste0("site", 1:10)
species.presence <- matrix(sample(0:1, 10*100, replace=TRUE),10, 100, dimnames = list(paste0("site", 1:10), spp.names))
View(species.presence)