get_sample: Function for getting binary matrix

Description Usage Arguments Value Examples

View source: R/aspect_importance.R

Description

Function creates binary matrix, to be used in aspect_importance method. It starts with a zero matrix. Then it replaces some zeros with ones. If sample_method = "default" it randomly replaces one or two zeros per row. If sample_method = "binom" it replaces random number of zeros per row - average number of replaced zeros can be controlled by parameter sample_method = "f". Function doesn't allow the returned matrix to have rows with only zeros.

Usage

1
get_sample(n, p, sample_method = c("default", "binom"), f = 2)

Arguments

n

number of rows

p

number of columns

sample_method

sampling method

f

frequency for binomial sampling

Value

a binary matrix

Examples

1
 get_sample(100,6,"binom",3)

triplot documentation built on July 13, 2020, 5:08 p.m.

Related to get_sample in triplot...