-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
45 lines (32 loc) · 1.97 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
---
authors: "Jennifer Ramos, Andres Herrera, Anahi Quezada"
date: "2024-11-14"
output:
pdf_document
---
## Github Workshop
## Interaction web
Interaction network analyses are a useful tool to understand the complex tropic relationships between two or more species. Bipartite networks are generally used, which present only two tropic levels. These networks quantify the number and intensity of interactions between the two tropic levels, allowing to visualize and quantify which species in a community have a greater relative interaction than the other species. In this case, we present the interaction networks between several bees from different dry forests at the tribe scale versus the plant families they visit. In this example we show two types of networks: the bipartite networks (plot web) where the linear interactions between the two tropic levels are presented and the matrix (visweb) where the intensity of the interaction between the tropic levels is shown with predetermined colors.
```{r setup, eval=FALSE}
input <- list.files(path = "C:/input/", pattern = ".csv$", full.names = TRUE)
names <- list.files(path = "C:/input/", pattern = ".csv$", full.names = FALSE)
Finalnam <- paste0("C:/metrics_", names) # Create output folder
for (i in 1:length(input)) {
matrix <- read.csv(input[i]) # Corrected variable name
matrix <- as.data.frame(matrix)
matrix <- matrix %>%
group_by(Tribe) %>%
summarise(across(everything(), sum, na.rm = TRUE))
matriz_values <- matrix[, 2:ncol(matrix)]
final_values <- as.matrix(matriz_values)
rownames(final_values) <- matrix$Tribe
net <- networklevel(final_values) # Ensure networklevel() is defined
write.csv(net, Finalnam[i], row.names = TRUE)
}
```
## Study area
This applied example was made in the Dry Forest of Colombia:
![Study Area](C:/Users/asque/Downloads/IMG_20241120_163851_425.jpg)
## Some plots
## View the HTML file
[click here to view the HTML file] (https://github.com/AndresHerrera2023/beewebs/blob/main/1.html)