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 2.530405
#> 2         1       2 2.209563
#> 3         1       3 5.364325
#> 4         1       4 3.650324
#> 5         1       5 4.229585
#> 6         1       6 5.704147
#> 7         1       7 5.149707
#> 8         1       8 1.294055
#> 9         1       9 4.323588
#> 10        1      10 1.391016
#> 11        2       1 4.859647
#> 12        2       2 6.973817
#> 13        2       3 9.023228
#> 14        2       4 1.806874
#> 15        2       5 9.815358
#> 16        2       6 7.116137
#> 17        2       7 5.420378
#> 18        2       8 5.530718
#> 19        2       9 3.259473
#> 20        2      10 4.193027