cyto_sample: Sample a flowFrame or flowSet

View source: R/cyto-helpers.R

cyto_sampleR Documentation

Sample a flowFrame or flowSet

Description

cyto_sample allows restriction of a flowFrame or flowSet by indicating the percentage or number of events to retain.

Usage

cyto_sample(x, ...)

## S3 method for class 'GatingHierarchy'
cyto_sample(x, display = 1, seed = NULL, ...)

## S3 method for class 'GatingSet'
cyto_sample(x, display = 1, seed = NULL, ...)

## S3 method for class 'flowFrame'
cyto_sample(x, display = 1, seed = NULL, ...)

## S3 method for class 'flowSet'
cyto_sample(x, display = 1, seed = NULL, ...)

## S3 method for class 'list'
cyto_sample(x, display = 1, seed = NULL, plot = FALSE, ...)

Arguments

x

object of class flowFrame, flowSet, GatingHierarchy or GatingSet.

...

not in use.

display

can be either a numeric [0,1] or integer to indicate the percentage or number of events to keep respectively.

seed

value used to set.seed() internally. Setting a value for seed will return the same result with each run.

plot

logical required for lists to indicate whether sampling should be scaled per flowFrame to retain original ratios, as used in cyto_plot.

Value

object of class flowFrame, flowSet, GatingHierarchy or GatingSet sampled to display events.

Author(s)

Dillon Hammill, Dillon.Hammill@anu.edu.au

Examples

# Load in CytoExploreRData to access files
library(CytoExploreRData)

# Load in samples
fs <- Activation

# Restrict first sample by 50%
cyto_sample(fs[[1]], 0.5)

# Restrict first sample to 10000 events
cyto_sample(fs[[1]], 10000)


DillonHammill/CytoExploreR documentation built on March 2, 2023, 7:34 a.m.