Learn R Programming

aqp (version 2.1.0)

subset,SoilProfileCollection-method: Subset a SoilProfileCollection with logical expressions

Description

subset() is a function used for extracting profiles from a SoilProfileCollection based on logical criteria. It allows the user to specify an arbitrary number of logical vectors (equal in length to site or horizon), separated by commas. The function includes some support for non-standard evaluation.

Usage

# S4 method for SoilProfileCollection
subset(x, ..., greedy = FALSE)

Value

A SoilProfileCollection.

Arguments

x

A SoilProfileCollection

...

Comma-separated set of R expressions that evaluate as TRUE or FALSE. Length for individual expressions matches number of sites OR number of horizons, in object.

greedy

Use "greedy" matching for combination of site and horizon level matches? greedy = TRUE is the union, whereas greedy = FALSE (default) is the intersection (of site and horizon matches).

Author

Andrew G. Brown.

Details

To minimize likelihood of issues with non-standard evaluation context, especially when using subset() inside another function, all expressions used in ... should be in terms of variables that are in the site or horizon data frame.