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
`[[` methods are not needed.
# S4 method for SoilProfileCollection subset(x, ..., greedy = FALSE) # S4 method for SoilProfileCollection filter(.data, ..., .preserve = FALSE)
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
Use "greedy" matching for combination of site and horizon level matches?
A SoilProfileCollection (
Relevant when the .data input is grouped. Not (yet) implemented for
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. If you need to use the base method after loading aqp, you can use
stats::filter to be explicit about which function you want. We mirror the dplyr package in over-loading the
filter method with a generic that allows for arbitrary number of vectors (
...) to be included in the "filter," which means you may also need to use
dplyr::filter as appropriate depending on the order you load packages or your conflict resolution option settings.
Andrew G. Brown.