Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #381: Rename linelist argument to data #437

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading