Skip to content

Commit

Permalink
Add input checks to offspring_ll()
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmbaazam committed Nov 10, 2023
1 parent 8a1d936 commit 5ddef94
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions R/stat_likelihoods.R
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,17 @@ geom_length_ll <- function(x, prob) {
#' )
offspring_ll <- function(x, offspring_dist, statistic,
nsim_offspring = 100, ...) {
# Input checking
checkmate::assert_numeric(
x, lower = 0, any.missing = FALSE
)
# check that offspring is properly specified
check_offspring_valid(offspring_dist)
checkmate::assert_character(statistic)
checkmate::assert_numeric(
nsim_offspring, lower = 1
)

# Simulate the chains
dist <- simulate_summary(
nchains = nsim_offspring,
Expand Down

0 comments on commit 5ddef94

Please sign in to comment.