This function simulates uniformly distributed birth times for a specified number of individuals from a provided vector
Arguments
- N
The number of individuals in the simulation
- times
A vector of each time step in the simulation
- age_min
A number matching the time resolution of
times
giving the youngest age possible by the end of the simulation; defaults to 0 which means individuals can be born up until the penultimate time step
See also
Other demography:
generate_pop_demography()
,
simulate_removal_times()
Examples
## Simulate random birth times for 500 individuals over 100 time steps and ensures
## that all individuals are above 9 time steps old by the last time step
simulate_birth_times(500, 1:100, age_min=9)
#> [1] 77 68 36 61 28 61 63 42 13 54 43 11 17 66 71 39 43 21 34 49 11 15 47 87 17
#> [26] 69 80 15 77 45 84 45 5 51 20 8 42 39 68 69 82 52 77 37 50 19 53 73 60 15
#> [51] 55 56 35 80 79 39 33 51 72 50 6 30 47 44 41 81 2 75 72 53 27 1 18 38 5
#> [76] 53 22 9 75 87 64 17 32 72 4 48 82 71 90 55 17 86 1 65 33 87 58 46 64 31
#> [101] 65 75 56 76 6 39 48 30 8 69 19 37 23 23 15 67 84 75 68 61 64 2 77 90 75
#> [126] 51 51 61 70 35 76 81 49 29 39 14 12 63 42 41 26 15 79 88 47 88 66 42 86 82
#> [151] 58 73 29 1 73 9 65 16 29 73 51 88 12 86 30 27 2 54 53 39 84 73 49 47 42
#> [176] 63 85 89 78 32 83 53 34 61 81 55 9 22 55 62 30 19 1 40 60 55 10 77 32 14
#> [201] 10 45 69 35 83 40 31 14 15 10 25 4 54 24 42 47 60 43 36 2 41 60 48 59 15
#> [226] 38 59 59 26 79 68 8 82 88 26 41 43 48 67 29 35 47 65 58 10 78 3 45 57 26
#> [251] 1 86 53 67 56 79 45 54 63 89 4 83 54 68 6 85 29 4 56 23 59 11 67 32 29
#> [276] 74 61 2 50 78 14 6 41 15 30 35 53 8 56 39 60 2 30 12 2 14 70 19 62 51
#> [301] 58 72 22 12 86 32 31 76 18 83 88 46 3 73 49 27 69 3 27 40 69 2 43 61 87
#> [326] 12 78 70 9 57 26 7 88 56 19 24 87 16 60 78 2 8 25 82 86 26 70 41 16 57
#> [351] 75 75 14 83 4 27 58 28 51 64 30 25 52 24 24 24 67 36 49 54 68 1 42 83 26
#> [376] 65 41 40 14 62 68 8 71 87 38 6 1 38 45 35 79 83 38 72 50 1 88 81 17 89
#> [401] 77 30 17 9 57 60 54 48 53 87 48 41 81 17 36 81 85 46 4 46 73 84 3 41 21
#> [426] 20 24 76 16 17 9 34 81 36 68 68 35 9 36 13 14 69 62 85 29 53 44 38 83 73
#> [451] 15 11 59 68 45 81 82 70 84 90 63 30 58 26 11 78 48 80 23 19 39 64 4 49 37
#> [476] 78 54 9 21 60 49 45 28 27 16 66 34 8 49 74 79 87 57 2 41 45 31 74 23 90