pRoloc (version 1.12.4)

sampleMSnSet: Extract a stratified sample of an MSnSet

Description

This function extracts a stratified sample of an MSnSet.

Usage

sampleMSnSet(object, fcol = "markers", size = 0.2, seed)

Arguments

object
An instance of class MSnSet
fcol
The feature meta-data column name containing the marker (vector or matrix) definitions on which the MSnSet will be stratified. Default is markers.
size
The size of the stratified sample to be extracted. Default is 0.2 (20 percent).
seed
The optional random number generator seed.

Value

A stratified sample (according to the defined fcol) which is an instance of class "MSnSet".

See Also

testMSnSet unknownMSnSet markerMSnSet. See markers for details about markers encoding.

Examples

Run this code
library(pRolocdata)
data(tan2009r1)
dim(tan2009r1)
smp <- sampleMSnSet(tan2009r1, fcol = "markers")
dim(smp)
getMarkers(tan2009r1)
getMarkers(smp)

Run the code above in your browser using DataLab