Skip to content

Commit

Permalink
Merge branch 'main' into rename-models
Browse files Browse the repository at this point in the history
  • Loading branch information
athowes authored Nov 15, 2024
2 parents bc00fd4 + b899cdb commit 9dfe112
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions R/simulate.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,19 @@ simulate_gillespie <- function(r = 0.2,
#' distribution. The input dataset should have the primary event times in a
#' column named `ptime`.
#'
#' @param linelist A data frame with the primary event times.
#' @param data A data frame with the primary event times.
#' @param dist The delay distribution to be used. Defaults to [rlnorm()].
#' @param ... Arguments to be passed to the delay distribution function.
#'
#' @return A `data.frame` that augments `linelist` with two new columns: `delay`
#' @return A `data.frame` that augments `data` with two new columns: `delay`
#' (secondary event latency) and `stime` (the time of the secondary event).
#'
#' @family simulate
#' @autoglobal
#' @importFrom dplyr mutate
#' @export
simulate_secondary <- function(linelist, dist = rlnorm, ...) {
linelist |>
simulate_secondary <- function(data, dist = rlnorm, ...) {
data |>
mutate(
delay = dist(dplyr::n(), ...),
stime = .data$ptime + .data$delay
Expand Down
6 changes: 3 additions & 3 deletions man/simulate_secondary.Rd

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

0 comments on commit 9dfe112

Please sign in to comment.