Learn R Programming

flowMerge (version 2.20.0)

map: Map matrix of probabilities to class assignments.

Description

Traverse the rows of a matrix of probabilities of size n x k, where the n rows are samples, and the k columns are the probability of assignment of the sample to each of k classes. The most probable class assignment is selected for each row and a vector of classes is returned.

Usage

map(z, ...)

Arguments

z
A matrix of probabilities.
...
Additional arguments, not currently used.

Value

A vector of class assignments of lenght n.

Examples

Run this code
z<-t(apply(t(replicate(100,rgamma(5,0.1,1))),1,function(x)x/sum(x)));
map(z);

Run the code above in your browser using DataLab