Skip to contents

Helper function: distributon repeater

Usage

distribution_repeater(
  number_of_repeatings = 10,
  number_of_events = 365,
  func,
  ...
)

Arguments

number_of_repeatings

how often should the random distribution with the same parameters be generated (default: 1)

number_of_events

number of events

func

distribution function to be repeated (e.g. runif, rlnorm, rnorm)

...

further parameters passed to func

Value

data.frame with columns repeatID, eventID and values

Examples

distribution_repeater(
  number_of_repeatings = 2,
  number_of_events = 10,
  func = runif,
  min = 1,
  max = 10
)
#>    repeatID eventID   values
#> 1         1       1 5.954387
#> 2         1       2 7.140930
#> 3         1       3 6.765581
#> 4         1       4 7.148458
#> 5         1       5 5.063850
#> 6         1       6 9.342030
#> 7         1       7 1.582334
#> 8         1       8 9.399786
#> 9         1       9 6.508423
#> 10        1      10 9.083203
#> 11        2       1 2.249625
#> 12        2       2 7.325043
#> 13        2       3 9.444259
#> 14        2       4 7.581221
#> 15        2       5 4.043713
#> 16        2       6 2.244634
#> 17        2       7 3.038931
#> 18        2       8 1.938243
#> 19        2       9 3.430064
#> 20        2      10 3.097549