Skip to content

Commit

Permalink
Merge pull request #189 from UCD-SERG/complete-rename
Browse files Browse the repository at this point in the history
updating instances of deprecated function names
  • Loading branch information
chrisorwa authored Jul 16, 2024
2 parents 662c265 + 98634ce commit be49297
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
9 changes: 7 additions & 2 deletions R/llik.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' Calculates the log-likelihood of a set of cross-sectional antibody response data, for a given incidence rate (`lambda`) value.
#' `r lifecycle::badge("deprecated")`
#'
#' `llik()` was renamed to `log_likelihood()` to create a more
#' `llik()` was renamed to [log_likelihood()] to create a more
#' consistent API.
#'
#' @keywords internal
Expand All @@ -19,7 +19,12 @@ llik <- function(
verbose = FALSE,
...) {
lifecycle::deprecate_warn("1.0.0", "llik()", "log_likelihood()")
log_likelihood(lambda, pop_data, antigen_isos, curve_params, noise_params, verbose = FALSE)
log_likelihood(lambda,
pop_data,
antigen_isos,
curve_params,
noise_params,
verbose)
}

#' Calculate log-likelihood
Expand Down
4 changes: 2 additions & 2 deletions R/sim.cs-utils.r
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ baseline <- function(kab, yvec, blims, ...) {
subst <- which(yvec < blims[kab, 2])
k <- 1
while (k <= length(subst)) {
yvec[subst[k]] <- mkbaseline(kab, 1, blims)
yvec[subst[k]] <- mk_baseline(kab, 1, blims)
k <- k + 1
}
return(yvec)
Expand All @@ -94,7 +94,7 @@ baseline <- function(kab, yvec, blims, ...) {
#' @title generate random sample from baseline distribution
#' @description
#' `r lifecycle::badge("deprecated")`
#' `mkbaseline()` was renamed to `mk_baseline()` to create a more
#' `mkbaseline()` was renamed to [mk_baseline()] to create a more
#' consistent API.
#' @param kab index for which row of antibody baseline limits to read from `blims`
#' @param n number of observations
Expand Down
2 changes: 1 addition & 1 deletion man/llik.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/mkbaseline.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vignettes/articles/simulate_xsectionalData.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,15 @@ ggplot(csdata, aes(
We can calculate the log-likelihood of the data as a function of the incidence rate directly:

```{r}
ll_A <- llik(
ll_A <- log_likelihood(
pop_data = csdata,
curve_params = dmcmc,
noise_params = cond,
antigen_isos = "HlyE_IgA",
lambda = 0.1
) %>% print()
ll_G <- llik(
ll_G <- log_likelihood(
pop_data = csdata,
curve_params = dmcmc,
noise_params = cond,
Expand Down

0 comments on commit be49297

Please sign in to comment.