clean_datras_data: Function to clean DATRAS survey data

Description Usage Arguments Details Examples

View source: R/clean_datras_data.R

Description

This function cleans up datras data uploaded into R, for example using the get_datras_data function. DATRAS data is typically messy and gathers information collected using different sampling protocols (gear type for instance). Analysing data across surveys without this cleaning step is therefore unadvisable. clean_data_datras runs a basic clean of the uploaded data (see Details).

Usage

1
clean_datras_data(survey, beam = F)

Arguments

survey

is an R data.frame

beam

is a boolean argument. Default value is FALSE. If TRUE, the data comes from a beam trawl survey, rather than from the Internation Bottom Trawl Survey (IBTS).

Details

The majority of surveys on DATRAS are IBTS surveys. There are consistent in sampling protocol from 1980 onwards. Among the other surveys only the English Beam Trawl survey have a consistent sampling protocol through time and other sources of information are excluded. Other cleaning rules include: gear consistency (GOV if IBTS survey or 4-meter beam trawl if English Trawl survey); haul validity; haul duration (hauls are normally 30 minutes long but can vary, we exclude overly short or long hauls).

Examples

1
2
3
4
5
6
data(datras_surveys)
mysurvey <- datras_surveys$survey[1]
myear <- datras_surveys$year[1]
myquarter <- datras_surveys$quarter[1]
mysurvey <- get_datras_data("HH", mysurvey, myear, myquarter)
mycleansurvey <- clean_datras_data(mysurvey, beam = F)

remsamp/Rmerp_public documentation built on May 3, 2019, 4:07 p.m.