powered by
Apply a function to samples from a given metadata's group.
apply_by_group(dataset, fn.to.apply, metadata.var, var.value)
list representing the dataset from a metabolomics experiment.
function to apply (e.g. mean, max, min).
name of the metadata's variable.
value of the metadata's variable.
Returns a vector with the variables and the value of the applied function.
# NOT RUN { ## Example of applying a function to a group data(cachexia) apply.group.result = apply_by_group(cachexia, mean, "Muscle.loss", "control") # }
Run the code above in your browser using DataLab