icesFO Functions to support the creation of ICES Fisheries Overviews, ….
icesFO is implemented as an R package
and available on GitHub
icesFO can be installed from GitHub using the install_github
command
from the devtools
package:
library(devtools)
install_github("ices-tools-prod/icesFO")
For a summary of the package:
library(icesFO)
?icesFO
icesFO is developed openly on GitHub.
Feel free to open an issue there if you encounter problems or have suggestions for future versions.
The current development version can be installed using:
library(devtools)
install_github("ices-tools-prod/icesFO@devel")
In this example the map of the Greater North Sea ecoregion is plotted
see
?icesFO::plot_ecoregion_map
for more details
first download the ices area shape and the ecoregion shape. Both are converted to sf polygons for easy plotting
library(icesFO)
# download data
ices_areas_nrs <- load_areas("Greater North Sea")
ecoregion_nrs <- load_ecoregion("Greater North Sea")
then the plot can be made:
# plot
eco_map <- plot_ecoregion_map(ecoregion_nrs, ices_areas_nrs)
## Warning in st_centroid.sf(ices_areas): st_centroid assumes attributes are
## constant over geometries of x
eco_map
In this example, the plots for ICES official catch statistics for the Baltic Sea Ecoregion are made. First the data is downloaded and formated
see
?icesFO::plot_catch_trends
for more details
library(icesFO)
# download data
hist <- load_historical_catches()
official <- load_official_catches()
prelim <- load_preliminary_catches(2018)
# format / process
catch_dat <- format_catches(2018, "Baltic Sea Ecoregion", hist, official, prelim)
## Joining, by = "X3A_CODE"
then the plot can be made:
# plot
p <-
plot_catch_trends(catch_dat, type = "COMMON_NAME",
line_count = 5, plot_type = "line")
p
In this example the map of the average swept area ration for the Celtic Sea ecoregion is plotted
see
?icesFO::plot_sar_map
for more details
first download the ICES ecoregion shape. Both are converted to sf polygons for easy plotting
library(icesFO)
# download data
ecoregion_cs <- load_ecoregion("Celtic Seas")
Then dowload the SAR data using the icesVMS package.
remotes::install_github("ices-tools-prod/icesVMS")
## Skipping install of 'icesVMS' from a github remote, the SHA1 (8f2fd475) has not changed since last install.
## Use `force = TRUE` to force installation
library(icesVMS)
# download data
sar <- icesVMS::get_sar_map("Celtic Seas")
## status code: 200
# convert to sf
sar$wkt <- sf::st_as_sfc(sar$wkt)
sar <- sf::st_sf(sar, sf_column_name = "wkt", crs = 4326)
then the plot can be made:
# plot
sar_map <- plot_sar_map(sar, ecoregion_cs, what = "subsurface")
sar_map
In this example, the plots of technical interactions between gears are shown
see
?icesFO::compute_technical_interactions
for more details
First we get the STECF landings data from the Baltic Sea Fishery overview repository.
library(icesTAF)
repoUrl <-
sprintf("https://raw.githubusercontent.com/ices-taf/%s/master/",
"2019_BtS_FisheriesOverview")
STECF_landings <-
read.taf(file.path(repoUrl, "bootstrap/initial/data/STECF_landings.csv"),
fileEncoding = "UTF-8-BOM", check.names = TRUE)
then the calculation and plot can be made:
technical_interacton <-
compute_technical_interactions(STECF_landings, catchCoverage = 0.99)
plot_technical_interactions(technical_interacton$recapLand)