numeric methods, generate numbers
Super class
charlatan::BaseProvider
-> NumericsProvider
Methods
Inherited methods
charlatan::BaseProvider$bothify()
charlatan::BaseProvider$check_locale()
charlatan::BaseProvider$lexify()
charlatan::BaseProvider$numerify()
charlatan::BaseProvider$random_digit()
charlatan::BaseProvider$random_digit_not_zero()
charlatan::BaseProvider$random_digit_not_zero_or_empty()
charlatan::BaseProvider$random_digit_or_empty()
charlatan::BaseProvider$random_element()
charlatan::BaseProvider$random_element_prob()
charlatan::BaseProvider$random_int()
charlatan::BaseProvider$random_letter()
charlatan::BaseProvider$randomize_nb_elements()
Method double()
get a double, pulls from normal distribution
Method norm()
get numbers from the normal distribution
Method beta()
get numbers from the beta distribution
Examples
z <- NumericsProvider$new()
z$double()
#> [1] -1.100637
z$double(10)
#> [1] -0.1762160 -0.7755324 0.6460795 1.1854533 1.1059711 -1.3830692
#> [7] 0.3607461 1.9837308 0.7030805 0.3223404
z$double(10, mean = 100)
#> [1] 99.26386 100.92543 100.02248 100.43882 99.81035 98.94781 100.56092
#> [8] 99.38064 100.72872 98.19701
z$double(10, mean = 100, sd = 17)
#> [1] 79.17019 61.97496 122.33597 111.96383 147.30464 116.01138 114.44807
#> [8] 100.51965 103.98325 91.62923
z$integer()
#> [1] 272
z$integer(10)
#> [1] 346 409 525 970 967 555 518 364 497 532
z$integer(10, 1, 20)
#> [1] 7 11 18 14 8 4 11 15 20 4
z$integer(10, 1, 10000000L)
#> [1] 6682705 4996657 3660836 5679635 3383176 9663176 9065521 9030513 6723482
#> [10] 5926754
z$unif()
#> [1] 3568.147
z$norm()
#> [1] 2.234025
z$lnorm(10)
#> [1] 0.3544324 2.1104438 2.3735381 0.4979741 0.2421386 0.7017915
#> [7] 8.0642186 2.1193485 0.9608720 10.4047043
z$beta(10, 1, 1)
#> [1] 0.16972989 0.94356301 0.33576618 0.49204581 0.88755264 0.02491335
#> [7] 0.55738752 0.96186427 0.02983940 0.54046309