NumericsProvider: NumericsProvider

NumericsProviderR Documentation

NumericsProvider

Description

numeric methods, generate numbers

Super class

charlatan::BareProvider -> NumericsProvider

Methods

Public methods

Inherited methods

Method double()

get a double, pulls from normal distribution

Usage
NumericsProvider$double(n = 1, mean = 0, sd = 1)
Arguments
n

(integer) number of values, default: 1

mean

mean value, default: 0

sd

standard deviation, default: 1


Method integer()

get an integer, runs sample() on range given

Usage
NumericsProvider$integer(n = 1, min = 1, max = 1000)
Arguments
n

(integer) number of values, default: 1

min

minimum value, default: 1

max

maximum value, default: 1000


Method unif()

get numbers from the uniform distribution

Usage
NumericsProvider$unif(n = 1, min = 0, max = 9999)
Arguments
n

(integer) number of values, default: 1

min

minimum value, default: 1

max

maximum value, default: 1000


Method norm()

get numbers from the normal distribution

Usage
NumericsProvider$norm(n = 1, mean = 0, sd = 1)
Arguments
n

(integer) number of values, default: 1

mean

mean value, default: 0

sd

standard deviation, default: 1


Method lnorm()

get numbers from the lognormal distribution

Usage
NumericsProvider$lnorm(n = 1, mean = 0, sd = 1)
Arguments
n

(integer) number of values, default: 1

mean

mean value, default: 0

sd

standard deviation, default: 1


Method beta()

get numbers from the beta distribution

Usage
NumericsProvider$beta(n = 1, shape1, shape2, ncp = 0)
Arguments
n

(integer) number of values, default: 1

shape1

non-negative parameters of the Beta distribution

shape2

non-negative parameters of the Beta distribution

ncp

non-centrality parameter, default: 0


Method clone()

The objects of this class are cloneable with this method.

Usage
NumericsProvider$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

z <- NumericsProvider$new()

z$double()
z$double(10)
z$double(10, mean = 100)
z$double(10, mean = 100, sd = 17)

z$integer()
z$integer(10)
z$integer(10, 1, 20)
z$integer(10, 1, 10000000L)

z$unif()
z$norm()
z$lnorm(10)
z$beta(10, 1, 1)

ropenscilabs/charlatan documentation built on Oct. 25, 2023, 12:26 a.m.