subset.DATRASraw {DATRAS}R Documentation

Subsetting a DATRASraw object.

Description

General method for subsetting a DATRASraw object.

Usage

  ## S3 method for class 'DATRASraw'
 subset(x, ..., na.rm = TRUE)

Arguments

x

Take subset of this dataset.

...

One or more subset criteria.

na.rm

Discard missing values in subset criterion?

Details

A DATRASraw object contains two kinds of information:

  1. Between haul information (contained in component 2)

  2. Within haul information (contained in component 1 and 3)

This method can subset over both kinds of information - at once. The functionality is achieved by matching each of the subset critera to the appropriate data component. When a match is found the subset is performed on the component and the subsetting is continued to the next subset criteria. The number of subset critera can be arbitrary and is given through the ... argument.

Value

The reduced dataset.

Examples


x <- readExchange(file1)
y <- subset(x,Species=="Gadus morhua",LngtCm>30,HaulDur>25)

[Package DATRAS version 1.0 Index]