vignettes/create-selectivity-sheet.Rmd
create-selectivity-sheet.RmdSTD: stands for the standard fishing gear usually used, it is the reference gear
TEST: stands for the gear modified with a new selective device to be tested
LAN: Fraction of the catch retained by the fisherman (= Landings)
DIS: Part of the catch not retained by the fisherman (= Discards)
FO: Fishing Operation
The sheet is generated in Word format for easy editing. It presents ‘relative’ selectivity indicators between the TEST gear and the STD gear. They quantify and characterize the improvement or decrease in the selectivity of the TEST gear compared to the STD gear.
→ This section characterizes the conditions associated with the selectivity experiment. It also allows us to verify whether the fishing operations were carried out under similar conditions in the case of a paired protocol.
→ Number of FOs and trials, dates of trials
LAN biomass for a defined list of species
Boxplots of LAN weights for both gears (STD and TEST)
Comparison test of the mean or median of the weights caught over the whole trial by each gear
Estimation of the variation of the LAN on the cumulated weights caught and intra pairs
DIS biomass for a defined list of discarded species
Distribution of DIS weights of both gears
Comparison test of the mean or median of the weights caught at the scale of the FO
Estimation of cumulative and intra-pair variation in DIS
create_selectivity_sheet()
# Create tmp folder
output_dir <- tempfile(pattern = "inser")
dir.create(output_dir)
# Setup input OTT data
OTT_data_folder <- system.file("script_origin","Data","Example_OTT", package = "inser")
TR <- readr::read_delim(
file = file.path(OTT_data_folder, "TR.csv"),
delim = ";",
escape_double = FALSE,
locale = readr::locale(encoding = "WINDOWS-1252"),
trim_ws = TRUE
)
#> Rows: 2 Columns: 31
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ";"
#> chr (12): sampling_type, landing_country, vessel_flag_country, project, harb...
#> dbl (11): trip_code, year, vessel_length, vessel_power, vessel_size, vessel_...
#> lgl (8): number_of_sets, days_at_sea, departure_date_time, return_date_time...
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
HH<-read.table(
file.path(OTT_data_folder, "HH.csv"),
sep=";",
header=TRUE,
encoding = "WINDOWS-1252")#,colClasses = colClasses)
SL<-read.table(
file.path(OTT_data_folder, "SL.csv"),
sep=";",
header=TRUE,
encoding = "WINDOWS-1252")
HL<-read.table(
file.path(OTT_data_folder, "HL.csv"),
sep=";",
header=TRUE,
encoding = "WINDOWS-1252")
colClasses<-rep(NA,ncol(HH))
colClasses[which(names(HH)=="statistical_rectangle")]<-"character"
HH<-read.table(
file.path(OTT_data_folder, "HH.csv"),
sep=";",
header=TRUE,
colClasses = colClasses,
encoding = "WINDOWS-1252")
# create TAB output
TAB <- prep_sel_data(data=list(TR,HH,SL,HL))
# Setup zone and min_length params
min_length <- data.frame(species=unique(TAB$species),min_length=c(27,24,20,NA,27,NA))
zones <- c("8.a","8.b","7.d","7.e","7.h")
# run function
create_selectivity_sheet(data = TAB,
output_dir = output_dir,
output_file = "fiche_InseR_twin",
protocol = "twin",
language = "FR",
zones=zones,
min_length=min_length)
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Coordinate system already present. Adding new coordinate system, which will
#> replace the existing one.
#> Using the FR version of the selectivity template
#>
#> processing file: selectivity_sheet_twin.Rmd
#>
#> output file: selectivity_sheet_twin.knit.md
#> /opt/hostedtoolcache/pandoc/3.1.11/x64/pandoc +RTS -K512m -RTS selectivity_sheet_twin.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output /tmp/RtmpUeqQY0/inser2482245bf1f3/fiche_InseR_twin.html --lua-filter /home/runner/work/_temp/Library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /home/runner/work/_temp/Library/rmarkdown/rmarkdown/lua/latex-div.lua --embed-resources --standalone --variable bs3=TRUE --section-divs --table-of-contents --toc-depth 3 --variable toc_float=1 --variable toc_selectors=h1,h2,h3 --variable toc_collapsed=1 --variable toc_smooth_scroll=1 --variable toc_print=1 --template /home/runner/work/_temp/Library/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --number-sections --variable theme=lumen --mathjax --variable 'mathjax-url=https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --include-in-header /tmp/RtmpUeqQY0/rmarkdown-str24823af2fcae.html
#>
#> Output created: /tmp/RtmpUeqQY0/inser2482245bf1f3/fiche_InseR_twin.html
# rstudioapi::filesPaneNavigate(output_dir)
# Clear tmp folder
unlink(output_dir, recursive = TRUE)