Skip to content

Commit

Permalink
Merge branch 'issue-300'
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinsimpson committed Jul 30, 2024
2 parents d7c32c3 + 9273442 commit de43bdc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Package: gratia
Version: 0.9.2.9005
Date: 2024-07-27
Version: 0.9.2.9006
Title: Graceful 'ggplot'-Based Graphics and Other Functions for GAMs Fitted Using 'mgcv'
Authors@R: c(person(given = "Gavin L.", family = "Simpson",
email = "ucfagls@gmail.com",
Expand Down
2 changes: 1 addition & 1 deletion R/smooth-estimates.R
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
}
## if they do all inherit from the correct class, then run term_names
## on each element and combine - returns $term and $by from each smooth
unlist(sapply(smooths, FUN = term_names))
unlist(lapply(smooths, FUN = term_names))
}

## check that the vars we need are in data
Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-confint-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ test_that("confint.fderiv example output", {
q <- quantile(x, prob = c(0 + v, 1 - v), type = 8)
seq(q[1], q[2], length = n)
}
new_data <- sapply(su_eg1[c("x0", "x1", "x2", "x3")], middle)
n_middle <- 25
new_data <- vapply(su_eg1[c("x0", "x1", "x2", "x3")], FUN = middle,
FUN.VALUE = numeric(n_middle), n = n_middle)
new_data <- data.frame(new_data)
## first derivatives of all smooths...
fd <- fderiv(m_gam, newdata = new_data)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-derivatives.R
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ test_that("derivatives() works for fs smooths issue 57 and 301", {
expect_doppelganger("draw issue 57 derivatives for factor by", plt)

# test variant in #301
logistic_growth_df$linearterm = runif(16)
logistic_growth_df$linearterm <- runif(16)
m_logistic_growth <- gam(y_obs ~ s(t, unit, k = 5, bs = "fs", m = 2) + linearterm,
data = logistic_growth_df, method = "REML")
expect_silent(fd <- derivatives(m_logistic_growth))
Expand Down

0 comments on commit de43bdc

Please sign in to comment.