diff --git a/R/globals.R b/R/globals.R index 291078809..9841e25ca 100644 --- a/R/globals.R +++ b/R/globals.R @@ -20,6 +20,18 @@ utils::globalVariables(c( "value", # "rel_value", # "value", # + "id", # + "obs_t", # + "obs_at", # + "ptime_lwr", # + "pwindow_upr", # + "stime_lwr", # + "ptime_upr", # + "stime_upr", # + "woverlap", # + "swindow_upr", # + "delay_central", # + "row_id", # "woverlap", # "row_id", # "ptime_daily", # @@ -83,5 +95,9 @@ utils::globalVariables(c( "stime", # "stime_daily", # "ptime_daily", # + "rlnorm", # + "delay", # + "stime", # + "ptime", # NULL )) diff --git a/R/latent_individual.R b/R/latent_individual.R index cc3c7b1c6..a20174f1b 100644 --- a/R/latent_individual.R +++ b/R/latent_individual.R @@ -1,10 +1,8 @@ #' @method epidist_prepare epidist_latent_individual #' @family latent_individual +#' @autoglobal #' @export epidist_prepare.epidist_latent_individual <- function(data, ...) { - id <- obs_t <- obs_at <- ptime_lwr <- pwindow_upr <- stime_lwr <- NULL - stime_upr <- woverlap <- swindow_upr <- stime_upr <- delay_central <- NULL - row_id <- ptime_upr <- NULL data <- data.table::as.data.table(data) data[, id := seq_len(.N)] data[, obs_t := obs_at - ptime_lwr] diff --git a/R/simulate.R b/R/simulate.R index 79e498ab6..8e9f9bdea 100644 --- a/R/simulate.R +++ b/R/simulate.R @@ -132,9 +132,9 @@ simulate_gillespie <- function(r = 0.2, #' (secondary event latency) and `stime` (the time of the secondary event). #' #' @family simulate +#' @autoglobal #' @export simulate_secondary <- function(linelist, dist = rlnorm, ...) { - delay <- ptime <- stime <- NULL obs <- data.table::copy(linelist) obs[, delay := dist(.N, ...)]