getRandomElements: Samples a random element.

Description Usage Arguments Value

View source: R/getRandomElements.R

Description

Similar to sample, but with the small exception, that giving a single value x as input is treated as a single vector and not like 1:x.

Usage

1
getRandomElements(x, size = 1L, replace = FALSE)

Arguments

x

[vector]
Source vector.

size

[integer(1)]
Number of random elements to draw.

replace

[logical(1)]
Draw random elements with or without replacement? Default is TRUE.

Value

[vector]


jakobbossek/JBmisc documentation built on May 18, 2019, 9:08 a.m.