itrax_reduce {itraxR} | R Documentation |
Reduce Itrax XRF data
Description
Reduces Itrax XRF data into arbitrary chunks using an arbitrary function. This is useful when making direct comparisons between the Itrax XRF data and some other data collected at a lower resolution.
Usage
itrax_reduce(
dataframe,
names = c(1:length(breaks_lower)),
breaks_lower,
breaks_upper,
fun = mean,
edges = c(">=", "<"),
by = NULL
)
Arguments
dataframe |
defines the name of the XRF data to reduce, usually a itraxR::itrax_import like tibble |
names |
optional, a vector of the same length as 'breaks' |
breaks_lower |
a vector of the lower limit of each chunk |
breaks_upper |
a vector of the upper limit of each chunk |
fun |
the function to apply in order to reduce the data. Default is mean(), but sd() is also common |
edges |
a vector of length 2 with the upper and lower bound behaviour; can be any of '<', '<=', '>', '>=' |
by |
if contiguous samples of even sizes are required, 'by' defines the chunk size and will automatically generate 'breaks' |
Value
a tibble with the same number of rows as 'breaks' and the same number of columns as 'dataframe'
Examples
itrax_reduce(dataframe = CD166_19_S1$xrf, by = 10)