Functions for padding respeciate objects.

rsp_pad pads a supplied (re)SPECIATE profile data set with profile and species meta-data.

rsp_pad(rsp, pad = "standard", drop.nas = TRUE)

Arguments

rsp

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

pad

character, type of meta data padding, current options 'profile', 'species', 'weight', 'reference', 'standard' (default; all but 'reference'), and 'all' (all).

drop.nas

logical, discard any rows where WEIGHT_PERCENT is NA, default TRUE.

Value

rsp_pad returns supplied respeciate data set, with requested additional profile and species meta-data added as additional data.frame columns. See Note.

Note

Some data handling can remove (re)SPECIATE meta-data, and rsp_pads provide a quick rebuild/repair. For example, rsp_dcasting to a (by-species or by-profile) widened form strips some meta-data, and padding is used as part of the rsp_melt_wide to re-add this meta-data when returning the data set to its standard long form.