sampleMSnSet: Extract a stratified sample of an 'MSnSet'

Description Usage Arguments Value Author(s) See Also Examples

View source: R/MSnSet.R

Description

This function extracts a stratified sample of an MSnSet.

Usage

1
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".

Author(s)

Lisa Breckels

See Also

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

Examples

1
2
3
4
5
6
7
library(pRolocdata)
data(tan2009r1)
dim(tan2009r1)
smp <- sampleMSnSet(tan2009r1, fcol = "markers")
dim(smp)
getMarkers(tan2009r1)
getMarkers(smp)

pRoloc documentation built on Nov. 8, 2020, 6:26 p.m.