rsp_x_ functions generate a vector of assignment terms and can be used to subset or condition a supplied (re)SPECIATE data.frame.

Most commonly, the rsp_x_ functions accept a single input, a (re)SPECIATE data.frame and return a logical vector of length nrow(x), identifying species of interest as TRUE. So, for example, they can be used when subsetting in the form:

subset(rsp, rsp_x_nalkane(rsp))

... to extract just n-alkane records from a supplied respeciate object rsp.

However, some accept additional arguments. For example, rsp_x_copy also accepts a reference data set, ref, and a column identifier, by, and tests rsp$by %in% unique(ref$by).

rsp_x_copy(rsp, ref = NULL, by = "species_id")

rsp_x_nalkane(rsp)

rsp_x_btex(rsp)

Arguments

rsp

a respeciate object, a data.frame of (re)SPECIATE profiles.

ref

(rsp_x_copy only) a second respeciate object, to be used as reference when subsetting (or conditioning) rsp.

by

(rsp_x_copy only) character, the name of the column in ref to copy when subsetting (or conditioning) rsp.

Value

rsp_x_copy outputs can be modified but, by default, it identifies all species in the supplied reference data set.

rsp_x_nalkane identifies (straight chain) C1 to C40 n-alkanes.

rsp_x_btex identifies the BTEX group of aromatic hydrocarbons (benzene, toluene, ethyl benzene, and M-, O- and P-xylene).