Skip to content

Commit b5220a3

Browse files
committed
Prelim modif of script 5
1 parent fb1c7da commit b5220a3

2 files changed

Lines changed: 41 additions & 2 deletions

File tree

R/05_new_species_traits.R

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,40 @@
1+
test <- rvest::read_html("https://fishbase.se/summary/Bagrus_docmak.html") |>
2+
rvest::html_elements(xpath = "//*[contains(@class, 'smallSpace')]")
3+
4+
5+
rfishbase::length_weight("Aristeus antennatus")
6+
7+
get_fishbase_length <- function(species_list) {
8+
test <- rfishbase::maturity(species_list = species_list) |>
9+
dplyr::filter(Type1 %in% c("TL", "FL")) |>
10+
dplyr::summarize(length = mean(LengthMatMin))
11+
}
12+
13+
rfishbase::maturity(species_list = species_list$scientific_name[1:6])
14+
15+
16+
test_length <- get_fishbase_length(species_list$scientific_name[1:6])
17+
18+
19+
fishbase_sp <- species_list |>
20+
dplyr::filter(class %in% c("Carangidae","Soleidae","Clupeidae","Engraulidae",
21+
"Trichiuridae","Chanidae","Eleotridae","Actinopterygii",
22+
"Poeciliidae","Scombridae","Clariidae","Cichlidae",
23+
"Dipneusti","Gobiidae","Gerreidae","Hemiramphidae",
24+
"Mugilidae","Clupeoidei","Leiognathidae",
25+
"Chirocentridae","Exocoetidae","Lactariidae",
26+
"Ariidae","Chondrichthyes","Lophiidae","Moridae",
27+
"Phycidae","Macrouridae","Alepocephalidae","Cyprinidae",
28+
"Haemulidae","Lutjanidae","Bagridae","Alepisauridae",
29+
"Mochokidae","Terapontidae","Sciaenidae","Latidae",
30+
"Alestidae","Tetraodontidae","Muraenesocidae",
31+
"Cynoglossidae","Sphyraenidae","Lepisosteidae",
32+
"Elasmobranchii","Coryphaenidae","Elopidae","Belonidae"))
33+
34+
sealifebase_sp <- species_list |>
35+
dplyr::filter(class %in% c("Insecta","Malacostraca","Mollusca","Polychaeta",
36+
"Invertebrate","Cephalopoda","Bivalvia","Crustacea"))
37+
138
# Load the interaction table to make a unique species list
239
resolved_inter_table <- readRDS("data/intermediate/resolved_inter_table.RDS")
340

@@ -89,10 +126,10 @@ species_list[which(species_list$scientific_name == "Pleuronectiforms"), c("class
89126
# For some species with way less information, sometime the same length is used for length min,mean and max
90127
# but to compute the bodymass min,mean and max the respective lower-bound, mean and highest-bound of parameters # a and b are used.
91128

92-
# Bagrus docmak0.00933 (https://fishbase.in/summary/Bagrus-docmak.html)
129+
# Bagrus docmak (https://fishbase.in/summary/Bagrus-docmak.html)
93130
species_list[which(species_list$scientific_name == "Bagrus docmak"),
94131
c("length_min","length_mean","length_max","a_min","a_mean","a_max","b_min","b_mean","b_max")] <-
95-
c(20,62,127,0.00730,0.00933,0.01193,2.94,3.00,3.06)
132+
c(20,62,127,0.00789,0.010000,0.01267,2.90,2.96,3.02)
96133

97134
# Carcharhinus melanopterus (https://fishbase.in/summary/Carcharhinus-melanopterus.html)
98135
species_list[which(species_list$scientific_name == "Carcharhinus melanopterus"),

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Masters project
2+
Main repository for my masters project at the University of Sherbrooke.
3+
Hierarchical models to predict predation (biomass flows) in complex trophic communities
24

35
## Steps of the code
46

0 commit comments

Comments
 (0)