intersect: Returns FLR objects trimmed to their shared dimensions.

intersectR Documentation

Returns FLR objects trimmed to their shared dimensions.

Description

Objects sharing certain dimensions, as inferred by their dimnames, are subset to the common ones along all dimensions. The returned object is of one of the FLlst classes, as corresponds to the input class. The objects in the list can then be, for example, combined or directly compared, as shown in the examples.

Usage

## S4 method for signature 'FLArray,FLArray'
intersect(x, y)

Arguments

x

First object to be compared and subset

y

Second object to be compared and subset

Value

And object of the corresponding FLsdt-based plural class.

Author(s)

The FLR Team

See Also

base::intercept

Examples

big <- FLQuant(64.39, dimnames=list(age=1:4, year=2001:2012))
small <- FLQuant(3.52, dimnames=list(age=2:3, year=2001:2005))
intersect(big, small)

# Two FLQuant objects can be added along their common dimension using Reduce() 
Reduce('+', intersect(big, small))

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