randomize: Randomizing Data

Description Usage Arguments Details Value Examples

View source: R/utils.R

Description

randomize permutates independently the entries in each column of a matrix-like object, to produce random data that can be used in permutation tests or bootstrap analysis.

Usage

1

Arguments

x

data to be permutated. It must be an object suitable to be passed to the function apply.

...

extra arguments passed to the function sample.

Details

In the context of NMF, it may be used to generate random data, whose factorization serves as a reference for selecting a factorization rank, that does not overfit the data.

Value

a matrix

Examples

1
2
3
x <- matrix(1:32, 4, 8)
randomize(x)
randomize(x)

NMF documentation built on May 29, 2017, 9:40 a.m.

Search within the NMF package
Search all R packages, documentation and source code