subset()
is a function used for subsetting SoilProfileCollections. 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 found in the tidyverse
. This greatly simplifies access to site and horizon-level variable compared to subset.default
, as `$`
or `[[`
methods are not needed.
# S4 method for SoilProfileCollection
subset(x, ..., greedy = FALSE)
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
.
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).
A SoilProfileCollection.
In base R, the method that performs extraction based on a set of expressions is subset
, so this is the "default" name in the AQP package. The filter
method is defined in the base R stats
package for linear filtering of time series.