tail: Returns the first and last parts of an FLQuant.

tail,FLQuant-methodR Documentation

Returns the first and last parts of an FLQuant.

Description

Standard tail and head methods can be applied along any dimension of an FLQuant object.

Usage

## S4 method for signature 'FLQuant'
tail(x, n = 1, dim = 2, ...)

## S4 method for signature 'FLQuant'
head(x, n = 1, dim = 2, ...)

Arguments

x

The object to extract from, FLQuant.

n

The number of elements to extract, numeric.

dim

Dimension to extract from, defaults to 2, 'year'.

Value

An FLQuant with the extracted elements.

Author(s)

Iago Mosqueira (WMR)

See Also

base::tail

Examples

x <- FLQuant(1:10)

# Extract the last 3 years
tail(x, 3)

# Extract all but the first 3 years
tail(x, -3)

# Extract the first 3 years
head(x, 3)

# Extract all but the last 3 years
head(x, -3)

flr/FLCore documentation built on May 4, 2024, midnight