sampleMSnSet {pRoloc} | R Documentation

## 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"`.

### Author(s)

Lisa Breckels

### See Also

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

### Examples

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

[Package pRoloc version 1.26.0 Index]