aggregate_samples: Aggregate samples

Description Usage Arguments Value Examples

Description

Aggregate samples according to an aggregate function like mean, median, etc.

Usage

1
2
aggregate_samples(dataset, indexes, aggreg.fn = "mean", 
meta.to.remove = c())

Arguments

dataset

list representing the dataset from a metabolomics experiment.

indexes

index vector with the samples that are going to be aggregated (e.g. c(1,1,2,2), this index vector will aggregate the first two samples and the last two samples).

aggreg.fn

aggregation function (e.g. "mean", "median", etc).

meta.to.remove

metadata's variables to be removed.

Value

Returns the dataset with the samples aggregated.

Examples

1
2
3
4
5
  ## Example of aggregating samples
  library(specmine.datasets)
  data(propolis)
  propolis_proc = missingvalues_imputation(propolis)
  dataset = aggregate_samples(propolis_proc, as.integer(propolis$metadata$seasons), "mean") 

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