Skip to content

Commit

Permalink
better name checking in GP terms
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicholas Clark committed Nov 14, 2023
1 parent 8044118 commit 0cf0567
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/families.R
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ family_to_mgcvfam = function(family){
} else if(family$family == 'student'){
gaussian()
} else if(family$family == 'lognormal'){
mgcv::Tweedie(p = 1.5, link = 'identity')
gaussian()
} else if(family$family == 'tweedie'){
mgcv::Tweedie(p = 1.5, link = 'log')
} else {
Expand Down
3 changes: 2 additions & 1 deletion R/gp.R
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,8 @@ prep_gp_covariate = function(data,
#' Clean GP names so no illegal characters are used in Stan code
#' @noRd
clean_gpnames = function(gp_names){
gp_names_clean <- gsub('(', '_', gp_names, fixed = TRUE)
gp_names_clean <- gsub(' ', '_', gp_names, fixed = TRUE)
gp_names_clean <- gsub('(', '_', gp_names_clean, fixed = TRUE)
gp_names_clean <- gsub(')', '_', gp_names_clean, fixed = TRUE)
gp_names_clean <- gsub(':', 'by', gp_names_clean, fixed = TRUE)
gp_names_clean <- gsub('.', '_', gp_names_clean, fixed = TRUE)
Expand Down
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.
Binary file modified tests/testthat/Rplots.pdf
Binary file not shown.

0 comments on commit 0cf0567

Please sign in to comment.