rpv_find: Iteratively find minimum set of samples by shuffling rows

Description Usage Arguments Value Examples

View source: R/find_samples.R

Description

Because rpv_indices() is deterministic, it may not present the minimum set that represents all variables. This procedure automates the process of randomly sampling the rows in the incoming matrix without replacement to find a minimum set.

Usage

1
rpv_find(tab, n = 10, sort = TRUE, cut = FALSE, progress = TRUE)

Arguments

tab

a numeric matrix with rownames

n

the number of permutations to perform

sort

when TRUE (default), the returned list will be sorted in order of number of samples.

cut

when TRUE, only the results with the minimum number of samples will be returned.

progress

when TRUE, a progress bar will be displayed.

Value

a list of character vectors

Examples

1
2
3
4
5
6
7
8
data(monilinia)
# Iterate over the data 100 times and return only the minimum values
set.seed(2018)
rpv_find(monilinia, n = 100, cut = TRUE, progress = FALSE)

# This is a random process and will not always return the same values
set.seed(201)
rpv_find(monilinia, n = 100, cut = TRUE, progress = FALSE)

zkamvar/repvar documentation built on May 7, 2019, 3:18 p.m.