powered by
Applies a function to the values of each variable
apply_by_variable(dataset, fn.to.apply, variables = NULL, variable.bounds = NULL, samples = NULL, ...)
list representing the dataset from a metabolomics experiment.
function to apply (e.g. mean, max, min).
allows to define which variables to calculate the stats (if numbers, indexes are assumed).
allow to define an interval of variables (if numeric).
if defined restricts the application to a given set of samples.
additional parameters to apply function.
Returns a vector with the variables and the value of the applied function.
# NOT RUN { ## Example of applying a function to variables library(specmine.datasets) data(cachexia) apply.variables.result = apply_by_variable(cachexia, mean) # }
Run the code above in your browser using DataLab