Causal effects of population dynamics and environmental changes on spatial variability of marine fishes
This repository is an implementaion for parsing all surveys in the Database of Trawl Surveys (DATRAS) from the International Council for the Exploration of the Sea (ICES) for research work Causal effects of population dynamics and environmental changes on spatial variability of marine fishes.
- For readers who want to quickly parse surveys, please refer to Quickly Getting Started.
- For readers who want to parse surveys from scratch, please refer to Step by Step Analysis.
The repository contains:
- Source code for parsing surveys
- Raw data downloaded from DATRAS via the R-package
icesDatras
(https://github.com/ices-tools-prod/icesDatras) provided by ICES. - Compiled species code defined in ICES
R program with version 3.5.0. R is a free software and publicly available at https://www.r-project.org/. To install R, please follow procedures below:
- Choose an CRAN Mirrors
- Choose your operating system
- Download binaries for base distribution
- Install R accordingly
Previous versions are available at https://cran.r-project.org/bin/windows/base/old/. All R-packages and the corresponding versions used in this study are listed below:
- icesDatras 1.3-0
-
Open
parse_survey.r
in R, and set the working directorywd
to the path where you save the repository. -
Run code in each survey block in
parse_survey.r
. For example, the following code block is for parsing Baltic International Trawl Survey (BITS).# BITS: Baltic International Trawl Survey data = "BITSdata" survey_path = paste0(file.path(wd, "survey_outside_north_sea", data), ".RData") load(survey_path) years = c(1991:2018) quarters = c(1, 4) parse_survey(data, years, quarters) rm(list=c(data, data_list))
After running the code, a csv file (
survey_name.csv
) will be generated and saved in the repository. This.csv
file summarizes time series data of each species in the survey. We will then filter species and surveys based on these.csv
files.We already provided all generated
.csv
file for each survey. Please check it in directorysurvey_stat
.
-
Use template code in
download_survey.R
to overview surveys in DATRAS. -
Use template code in
download_survey.R
to download age surveys data in DATRAS.Please save survey data in directory
survey_north_sea
andsurvey_outside_north_sea
accordingly. -
Open
parse_species_code.r
in R, and set the working directorywd
to the path where you save the repository. -
Run
parse_species_code.R
to compile species code defined by ICES in each survey.We have compiled a species-name chart (
Species code.csv
) to facilitate transformation of species code to Latin name and common name. -
Open
parse_survey.r
in R, and set the working directorywd
to the path where you save the repository. -
Run code in each survey block in
parse_survey.r
as described in Quickly Getting Started above.
If you find any bugs or have any questions about the implementation, pelease contact us via r03241220@ntu.edu.tw