diff --git a/R/families.R b/R/families.R index 706cbaad..7569e0f3 100644 --- a/R/families.R +++ b/R/families.R @@ -342,13 +342,15 @@ family_to_brmsfam = function(family){ } #' Set which family to use when setting up the gam object +#' Stick to Gaussian where possible to ensure the initial setup +#' doesn't fail #' @noRd family_to_mgcvfam = function(family){ if(family$family == 'beta'){ mgcv::betar() } else if(family$family == 'student'){ gaussian() - } else if(family$family == 'lognormal'){ + } else if(family$family %in% c('gamma', 'Gamma', 'lognormal')){ gaussian() } else if(family$family == 'tweedie'){ mgcv::Tweedie(p = 1.5, link = 'log') diff --git a/R/gp.R b/R/gp.R index e28e3f73..a7a92769 100644 --- a/R/gp.R +++ b/R/gp.R @@ -50,7 +50,7 @@ make_gp_additions = function(gp_details, data, # Find the correct k to ensure that the total number of coefficients # when using gp(k = k) is the same as when using s(k = k + 1) - smooth_terms <- unlist(purrr::map(mgcv_model$smooth, 'term')) + smooth_terms <- unlist(paste0(purrr::map(mgcv_model$smooth, 'term'))) smooth_bys <- unlist(purrr::map(mgcv_model$smooth, 'by')) if(any(smooth_bys == 'NA')){ smooth_bys[smooth_bys == 'NA'] <- NA diff --git a/src/RcppExports.o b/src/RcppExports.o index 3738bd53..849c29a4 100644 Binary files a/src/RcppExports.o and b/src/RcppExports.o differ diff --git a/src/mvgam.dll b/src/mvgam.dll index a8ea9649..f9138185 100644 Binary files a/src/mvgam.dll and b/src/mvgam.dll differ diff --git a/src/trend_funs.o b/src/trend_funs.o index 371ea49f..faf098a5 100644 Binary files a/src/trend_funs.o and b/src/trend_funs.o differ diff --git a/tests/testthat/Rplots.pdf b/tests/testthat/Rplots.pdf index 16ddf518..0ca4d416 100644 Binary files a/tests/testthat/Rplots.pdf and b/tests/testthat/Rplots.pdf differ