Skip to content

Commit

Permalink
Fix to some lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
athowes committed Jun 6, 2024
1 parent 38d4632 commit fc39702
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/ltcad.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
#' @family ltcad
#' @export
epidist_prepare.epidist_ltcad <- function(data) {
id <- obs_t <- obs_at <- NULL
ptime_lwr <- pwindow_upr <- stime_lwr <- ptime_upr <- NULL
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]
Expand All @@ -16,11 +17,11 @@ epidist_prepare.epidist_ltcad <- function(data) {
data[, swindow_upr := stime_upr - stime_lwr]
data[, delay_central := stime_lwr - ptime_lwr]
data[, row_id := seq_len(.N)]

if (nrow(data) > 1) {
data <- data[, id := as.factor(id)]
}

return(data)
}

Expand All @@ -32,7 +33,7 @@ epidist_priors.epidist_ltcad <- function(data) {
}

#' Define a formula for the ltcad model
#'
#'
#' @param delay_central Formula for the delay mean. Defaults to intercept only.
#' @param sigma Formula for the delay standard deviation. Defaults to intercept
#' only.
Expand Down Expand Up @@ -119,7 +120,6 @@ epidist_stancode.epidist_ltcad <- function(data,
stanvars_parameters + stanvars_tparameters + stanvars_priors
}


#' @method epidist epidist_ltcad
#' @family ltcad
#' @export
Expand Down

0 comments on commit fc39702

Please sign in to comment.