Comparing changes
Open a pull request
- 3 commits
- 6 files changed
- 0 comments
- 1 contributor
- +3 −3 DESCRIPTION
- +8 −0 NEWS.md
- +1 −1 R/functions.R
- +1 −1 README.md
- +2 −0 vignettes/plot-gamms.Rmd
- +32 −1 vignettes/plot-smooths.Rmd
| @@ -1,8 +1,8 @@ | ||
| Package: tidymv | ||
| Type: Package | ||
| Title: Tidy Model Visualisation | ||
| Version: 1.5.2 | ||
| Date: 2018-10-22 | ||
| Version: 1.5.3 | ||
| Date: 2018-11-16 | ||
| Authors@R: person("Stefano", "Coretta", email = paste0("stefano.coretta", "@", "gmail.com"), | ||
| role = c("aut", "cre")) | ||
| Description: This package provides functions for model visualisation using tidy | ||
| @@ -12,7 +12,7 @@ BugReports: https://github.com/stefanocoretta/tidymv/issues | ||
| License: MIT + file LICENSE | ||
| Encoding: UTF-8 | ||
| LazyData: true | ||
| RoxygenNote: 6.1.0 | ||
| RoxygenNote: 6.1.1 | ||
| Imports: cowplot, | ||
| dplyr, | ||
| ggplot2, | ||
| @@ -1,5 +1,12 @@ | ||
| # Change Log | ||
|
|
||
| ## [1.5.3] - 2018-11-16 | ||
| ### Added | ||
| - plot difference smooth in vignette | ||
|
|
||
| ### Changed | ||
| - added deprecated notice in vignette | ||
|
|
||
| ## [1.5.2] - 2018-10-22 | ||
| ### Fixed | ||
| - error with updated `rlang` | ||
| @@ -85,6 +92,7 @@ | ||
| - `create_start_event` function | ||
| - `plot_gamsd` function | ||
|
|
||
| [1.5.3]: https://github.com/stefanocoretta/tidymv/compare/v1.5.2...v1.5.3 | ||
| [1.5.2]: https://github.com/stefanocoretta/tidymv/compare/v1.5.1...v1.5.2 | ||
| [1.5.1]: https://github.com/stefanocoretta/tidymv/compare/v1.5.0...v1.5.1 | ||
| [1.5.0]: https://github.com/stefanocoretta/tidymv/compare/v1.4.0...v1.5.0 | ||
| @@ -281,7 +281,7 @@ plot_smooths <- function(model, time_series, comparison = NULL, facet_terms = NU | ||
| #' @importFrom magrittr "%>%" | ||
| #' @export | ||
| plot_gamsd <- function(model, view, comparison, conditions = NULL, rm_re = FALSE, bw = FALSE, ylim = NULL) { | ||
| .Deprecated("plot_smooth", msg = "'plot_gamsd' is deprecated and will be removed, use 'plot_smooths()' and 'plot_difference'.\n") | ||
| .Deprecated("plot_smooth", msg = "'plot_gamsd' is deprecated and will be removed, use 'plot_smooths()' and 'plot_difference()'.\n") | ||
|
|
||
| diff.df <- itsadug::plot_diff( | ||
| model, | ||
| @@ -4,6 +4,6 @@ This is the repository of the `R` package `tidymv`. This package provides functi | ||
|
|
||
| ## Installation | ||
|
|
||
| To install the package, use `devtools::install_github("stefanocoretta/tidymv@v1.5.2", build_vignettes = TRUE)`. To learn how to use the package, do `vignette("plot-smooths", package = "tidymv")` after the installation. | ||
| To install the package, use `devtools::install_github("stefanocoretta/tidymv@v1.5.3", build_vignettes = TRUE)`. To learn how to use the package, do `vignette("plot-smooths", package = "tidymv")` after the installation. | ||
|
|
||
| If you wish to install the development version, use `devtools::install_github("stefanocoretta/tidymv", build_vignettes = TRUE)`. | ||
| @@ -17,6 +17,8 @@ library(itsadug) | ||
| library(tidymv) | ||
| ``` | ||
|
|
||
| **This vignette willl be kept for some time and then removed. The function `plot_gamsd()` is deprecated and will be removed, Please, use `plot_smooths()` and `plot_difference()` instead.** | ||
|
|
||
| The estimated smooths and the difference smooth of factor predictors from a `gam` model can be plotted with `plot_gamsd()`. | ||
| This function has now been deprecated and will be removed in future versions. | ||
| This vignette is kept for historical reasons. | ||
| @@ -127,4 +127,35 @@ plot_smooths( | ||
| split = list(GroupCondition = c("Group", "Condition")) | ||
| ) + | ||
| theme(legend.position = "top") | ||
| ``` | ||
| ``` | ||
|
|
||
| ## Plotting the difference smooth | ||
|
|
||
| The difference smooth can be plotted with `plot_difference()`. | ||
| Portions of the difference smooth that do not inlcude 0 are shaded in red. | ||
|
|
||
| ```{r plot-diff-model} | ||
| plot_difference( | ||
| model, | ||
| time_series = x2, | ||
| difference = list(fac = c("1", "2")) | ||
| ) | ||
| ``` | ||
|
|
||
| To plot a difference smooth from a model with factor interactions, it is possible to specify the two levels to compare from the factor interaction (the argument `split` is not supported in `plot_difference()`). | ||
|
|
||
| ```{r plot-diff-inter-1} | ||
| plot_difference( | ||
| model_inter, | ||
| Time, | ||
| difference = list(GroupCondition = c("Children.1", "Adults.1")) | ||
| ) | ||
| ``` | ||
|
|
||
| ```{r plot-diff-inter-3} | ||
| plot_difference( | ||
| model_inter, | ||
| Time, | ||
| difference = list(GroupCondition = c("Children.3", "Adults.3")) | ||
| ) | ||
| ``` | ||