apply_by_group: Apply by group

Description Usage Arguments Value Examples

Description

Apply a function to samples from a given metadata's group.

Usage

1
apply_by_group(dataset, fn.to.apply, metadata.var, var.value)

Arguments

dataset

list representing the dataset from a metabolomics experiment.

fn.to.apply

function to apply (e.g. mean, max, min).

metadata.var

name of the metadata's variable.

var.value

value of the metadata's variable.

Value

Returns a vector with the variables and the value of the applied function.

Examples

1
2
3
4
5
     ## Example of applying a function to a group
	 library(specmine.datasets)
     data(cachexia)
     apply.group.result = apply_by_group(cachexia, mean, "Muscle.loss", 
			  "control")

specmine documentation built on Sept. 21, 2021, 5:06 p.m.