library(nprcgenekeepr)
ped <- nprcgenekeepr::qcPed
candidates <- nprcgenekeepr::qcBreeders
## Non-harem: pre-seed group 1 with animals already assigned; a
## second, empty group is initialized ready to be filled.
currentGroups <- list(candidates[1L:3L])
groupMembers <- makeGroupMembers(
numGp = 2L, currentGroups = currentGroups, candidates = candidates,
ped = ped, harem = FALSE, minAge = 1L
)
groupMembers
## Harem: each group is seeded with one available male (uses sample()).
set.seed(1L)
haremMembers <- makeGroupMembers(
numGp = 2L, currentGroups = list(), candidates = candidates,
ped = ped, harem = TRUE, minAge = 1L
)
haremMembers
Run the code above in your browser using DataLab