Learn R Programming

misha (version 4.2.9)

gsample: Returns samples from the values of track expression

Description

Returns a sample of the specified size from the values of track expression.

Usage

gsample(expr = NULL, n = NULL, intervals = NULL, iterator = NULL, band = NULL)

Value

An array that represent quantiles.

Arguments

expr

track expression

n

a number of items to choose

intervals

genomic scope for which the function is applied

iterator

track expression iterator. If 'NULL' iterator is determined implicitly based on track expression.

band

track expression band. If 'NULL' no band is used.

Details

This function returns a sample of the specified size from the values of track expression. If 'n' is less than the total number of values, the data is randomly sampled. The seed of the pseudo-random generator can be controlled through 'grnd.seed' option.

If 'n' is higher than the total number of values, all values are returned (yet reshuffled).

See Also

gextract

Examples

Run this code
# \dontshow{
options(gmax.processes = 2)
# }

gdb.init_examples()
gsample("sparse_track", 10)

Run the code above in your browser using DataLab