Skip to content

Commit

Permalink
Reduced run time of add_term example
Browse files Browse the repository at this point in the history
  • Loading branch information
adibender committed Sep 8, 2019
1 parent 11b82cc commit 57f2fd0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions R/add-functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
#' @importFrom stats model.matrix vcov
#' @examples
#' library(ggplot2)
#' ped <- as_ped(tumor, Surv(days, status)~ age, cut = seq(0, 2000, by =20))
#' ped <- as_ped(tumor, Surv(days, status)~ age, cut = seq(0, 2000, by = 100))
#' pam <- mgcv::gam(ped_status ~ s(tend) + s(age), family = poisson(),
#' offset = offset, data = ped)
#' #term contribution for sequence of ages
#' s_age <- ped %>% make_newdata(age = seq_range(age, 100)) %>%
#' s_age <- ped %>% make_newdata(age = seq_range(age, 50)) %>%
#' add_term(pam, term = "age")
#' ggplot(s_age, aes(x = age, y = fit)) + geom_line() +
#' geom_ribbon(aes(ymin = ci_lower, ymax = ci_upper), alpha = .3)
#' # term contribution relative to mean age
#' s_age2 <- ped %>% make_newdata(age = seq_range(age, 100)) %>%
#' s_age2 <- ped %>% make_newdata(age = seq_range(age, 50)) %>%
#' add_term(pam, term = "age", reference = list(age = mean(.$age)))
#' ggplot(s_age2, aes(x = age, y = fit)) + geom_line() +
#' geom_ribbon(aes(ymin = ci_lower, ymax = ci_upper), alpha = .3)
Expand Down
2 changes: 2 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
0 errors | 0 warnings | 0 notes

* A simple maintainance release to support upcoming version of tidyr
* Fixed relative link in NEWS.md
* Reduced run length of add_term example

## Reverse dependencies

Expand Down
6 changes: 3 additions & 3 deletions man/add_term.Rd

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

0 comments on commit 57f2fd0

Please sign in to comment.