itrax_reduce: Reduce Itrax XRF data

View source: R/itrax_reduce.R

itrax_reduceR 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)


itraxR documentation built on July 26, 2023, 5:48 p.m.

Related to itrax_reduce in itraxR...