Skip to contents

Chop AirDAS data into effort segments by continuous effort section

Usage

airdas_chop_section(x, ...)

# S3 method for class 'data.frame'
airdas_chop_section(x, ...)

# S3 method for class 'airdas_df'
airdas_chop_section(
  x,
  conditions,
  distance.method = NULL,
  num.cores = NULL,
  ...
)

Arguments

x

airdas_df object, or a data frame that can be coerced to a airdas_df object. This data must be filtered for 'OnEffort' events; see the Details section below

...

ignored

conditions

see airdas_effort

distance.method

character; see airdas_effort. Default is NULL since these distances should have already been calculated in airdas_effort

num.cores

See airdas_effort

Value

See airdas_chop_equallength. The randpicks values will all be NA

Details

WARNING - do not call this function directly! It is exported for documentation purposes, but is intended for internal package use only.

This function is simply a wrapper for airdas_chop_equallength. It calls airdas_chop_equallength, with seg.km set to a value larger than the longest continuous effort section in x. Thus, the effort is 'chopped' into the continuous effort sections and then summarized.

See the Examples section for an example where the two methods give the same output. Note that the longest continuous effort section in the sample data is ~32km.

For an example of how to summarize data by transect, see vignette("swfscAirDAS"). In short, if looking to group by individual transects, use segdata$transect_idx <- cumsum(segdata$event == "T") to create a column with a transect index. Then you can use group_by(transect_idx) and summarise to summarise the desired data by transect

Examples

y <- system.file("airdas_sample.das", package = "swfscAirDAS")
y.proc <- airdas_process(y)

y.eff1 <- airdas_effort(y.proc, method = "equallength", seg.km = 35, num.cores = 1)
#> No argument was passed via randpicks.load, and thus new randpicks values will be generated
y.eff2 <- airdas_effort(y.proc, method = "section", num.cores = 1)

all.equal(y.eff1, y.eff2)
#> [1] TRUE