Skip to content

Commit

Permalink
fix a few cmdcheck issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasjclark committed Jul 22, 2024
1 parent 44a9b5c commit 5cf3ddc
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions R/backends.R
Original file line number Diff line number Diff line change
Expand Up @@ -638,10 +638,10 @@ read_csv_as_stanfit <- function(files, variables = NULL,

# Can make LV models slightly more efficient by not filling in zeros in a loop
if(any(grepl('lv_coefs_raw[i, j] = 0;', stan_file, fixed = TRUE))){
starts <- mvgam:::grepws('lv_coefs_raw[i, j] = 0;', stan_file) - 2
ends <- mvgam:::grepws('lv_coefs_raw[i, j] = 0;', stan_file) + 2
starts <- grepws('lv_coefs_raw[i, j] = 0;', stan_file) - 2
ends <- grepws('lv_coefs_raw[i, j] = 0;', stan_file) + 2
stan_file <- stan_file[-c(starts:ends)]
stan_file[mvgam:::grepws('matrix[n_series, n_lv] lv_coefs_raw;', stan_file)] <-
stan_file[grepws('matrix[n_series, n_lv] lv_coefs_raw;', stan_file)] <-
'matrix[n_series, n_lv] lv_coefs_raw = rep_matrix(0, n_series, n_lv);'
}

Expand Down
2 changes: 1 addition & 1 deletion R/globals.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ utils::globalVariables(c("y", "year", "smooth_vals", "smooth_num",
"name", "needed", "nmix_trendmap", "orig_formula",
"trial", "use_var1", "use_var1cor", "xcols_drop",
"time_lag", "dis_time", "maxt", "orig_rows",
"matches", "time.", "file_name"))
"matches", "time.", "file_name", ".data"))
6 changes: 3 additions & 3 deletions R/monotonic.R
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ eval_smoothDotmodDotsmooth = function(smooth,

# set some values to NA if too far from the data
if (gratia::smooth_dim(smooth) == 2L && (!is.null(dist) && dist > 0)) {
eval_sm <- too_far_to_na(smooth,
eval_sm <- gratia::too_far_to_na(smooth,
input = eval_sm,
reference = model[["model"]],
cols = c(".estimate", ".se"),
Expand Down Expand Up @@ -561,7 +561,7 @@ eval_smoothDotmoiDotsmooth = function(smooth,

# set some values to NA if too far from the data
if (gratia::smooth_dim(smooth) == 2L && (!is.null(dist) && dist > 0)) {
eval_sm <- too_far_to_na(smooth,
eval_sm <- gratia::too_far_to_na(smooth,
input = eval_sm,
reference = model[["model"]],
cols = c(".estimate", ".se"),
Expand Down Expand Up @@ -626,7 +626,7 @@ eval_smoothDotmoiDotsmooth = function(smooth,
## if this is a by variable, filter the by variable for the required
## level now
if (gratia::is_factor_by_smooth(smooth)) {
data <- data %>% filter(.data[[by_var]] == gratia::by_level(smooth))
data <- data %>% dplyr::filter(.data[[by_var]] == gratia::by_level(smooth))
}
}
data
Expand Down
4 changes: 2 additions & 2 deletions R/stan_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ print.mvgammodel = function(x, ...){
#' @export
#' @importFrom brms stancode
#' @rdname code
stancode.mvgam_prefit = function(object){
stancode.mvgam_prefit = function(object, ...){

code(object)
}

#' @export
#' @rdname code
stancode.mvgam = function(object){
stancode.mvgam = function(object, ...){

code(object)
}
Expand Down
4 changes: 2 additions & 2 deletions man/code.Rd

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

2 changes: 2 additions & 0 deletions man/mvgam_marginaleffects.Rd

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

Binary file modified src/RcppExports.o
Binary file not shown.
Binary file modified src/mvgam.dll
Binary file not shown.
Binary file modified src/trend_funs.o
Binary file not shown.

0 comments on commit 5cf3ddc

Please sign in to comment.