library(tidyverse)
<- read_csv("https://heima.hafro.is/~einarhj/data/fao-capture-statistics.csv") fao
Background on the data used
FAO capture statistics in area 31
Location: https://heima.hafro.is/~einarhj/data/fao-capture-statistics.csv
The FAO dataset contains capture catch statistics from FAO area 31 by species and country for the years 1950 to 2021 (66673 records). The data set contains the following variables:
- area: FAO area code (only area 31)
- year: year
- country: country name in english
- species: “species” name in english
- catch: catch volume (kg if measure is ‘Q_ltw’)
- measure: unit of measure, mostly ‘Q_ltw’
- sid: 3 letter species code
- latin: latin name of “species”
- country_iso_3: 3 letter country code
You can import this data directly into R by:
Minke dataset
Location: https://heima.hafro.is/~einarhj/data/minke.csv
The minke whale dataset contains biological measurements from 192 scientific catches of minke whales between the year 2003 and 2007. The data set contains the following variables:
- whale.id: Unique identifier for the whale
- date.caught: the date when the whales was caught
- lat: latitude
- lon: longitude
- area: Derived from location (North/South)
- length: length of the whale (cm)
- weight: weight of the whale (kg)
- age: age of the whale (years)
- sex: Male or Female
- maturity: maturity status of the whale
- stomach.volume: volume of the stomach content (liters)
- stomach.weight: weight of the stomach content (kg)
- year: the year when the whale was caught
You can import this data directly into R by:
library(tidyverse)
<- read_csv("https://heima.hafro.is/~einarhj/data/minke.csv") minke
Icelandic groundfish trawl-survey dataset
The Icelandic groundfish trawl-survey has been conducted since 1985 and contains ~550+ annual stations. In the survey all species are identified and counted. In recent decades a subsample of each species at each survey station in length-measured. In addition, detailed measurments such as total weight, gutted, live and gonad weights as well as otolith extractions (to determine age) are done on a subset of target species. The data provided here contains only the summary of the abundance and weight of 6 species.
Location:
- Station table: https://heima.hafro.is/~einarhj/data/is_smb_stations.csv
- Biological table: https://heima.hafro.is/~einarhj/data/is_smb_biological.csv
The station table contains a lot of variables (28), here we will only comment on some of them:
- id: Unique identifier for each station
- date: Date that the station was taken
- vid: Vessel identification number
- t1, t2: Time at start and end of of hauling
- lon1, lat1, lon2, lat2: Position at start and end of haul.
- z1, z2: Depth at start and end of hauling
- temp_s: Mean surface temperature during hauling
- temp_b: Mean bottom temperature during hauling
The biological table contains the following variables:
- id: Station id
- species: Species name
- kg: Total weight in kilograms
- n: Total number of fish
You can import these data directly into R by:
library(tidyverse)
<-
station read_csv("https://heima.hafro.is/~einarhj/data/is_smb_stations.csv")
<-
biological read_csv("https://heima.hafro.is/~einarhj/data/is_smb_biological.csv")
Flying fish
This is a dataset of summarised catch and effort by year, month, country of a subsample of the fishing fleet targeting flying fish.
- Year: Year, ranging from 1998 to 2008
- Month: As numeric value
- Country: Country name
- Vessel: Vessel type
Weight (kg)
: The monthly weight of the catch in kilograms- Trips: The number of trips in the sample
You can import these data directly into R by:
<-
d read_csv("https://heima.hafro.is/~einarhj/older/crfmr/data-raw/flyingfish.csv")
Rows: 589 Columns: 6
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (2): Country, Vessel
dbl (4): Year, Month, Weight (kg), Trips
ℹ 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.
NOTE: This is a subsample of the fleet and the proportion of the effort of catch and effort may have varied through time by fleet and country.
Appendix
The code to get the FAO data
library(tidyverse)
# This may not be the path to the latest FAO capture data. Check the website
# and ammend path accordingly
<- "https://www.fao.org/fishery/static/Data/Capture_2023.1.1.zip"
pth <- basename(pth)
fil download.file(pth, destfile = paste0("data-raw/", fil))
unzip(paste0("data-raw/", fil), exdir = "data-raw")
<-
cntr read_csv("data-raw/CL_FI_COUNTRY_GROUPS.csv") |>
::clean_names() |>
janitorselect(cid = un_code, country_iso3 = iso3_code, country = name_en)
<-
species read_csv("data-raw/CL_FI_SPECIES_GROUPS.csv") |>
::clean_names() |>
janitorselect(sid = x3a_code, species = name_en, latin = scientific_name)
<-
cntr_plus read_csv("data-raw/CL_FI_COUNTRY_GROUPS.csv") |>
::clean_names() |>
janitorselect(cid = un_code, country_iso3 = iso3_code, country = name_en) |>
filter(country %in% c("Sri Lanka", "Sierra Leone", "Tanzania, United Rep. of",
"Papua New Guinea")) |>
pull(cid)
<-
d read_csv("data-raw/Capture_Quantity.csv") |>
::clean_names() |>
janitorfilter(area_code == "31" |
%in% cntr_plus) |>
country_un_code select(cid = country_un_code,
sid = species_alpha_3_code,
area = area_code,
year = period,
catch = value,
|>
measure) left_join(cntr) |>
left_join(species) |>
select(area, year, country, species, catch, measure, sid, latin, country_iso3)
|> write_csv("/net/hafri.hafro.is/export/home/hafri/einarhj/public_html/data/fao-capture-statistics.csv")
d system("chmod -R a+rX /net/hafri.hafro.is/export/home/hafri/einarhj/public_html/data/")
::island |>
geowrite_csv("/net/www/export/home/hafri/einarhj/public_html/data/island.csv")
system("chmod -R a+rX /net/www/export/home/hafri/einarhj/public_html/data/")