Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
base repository: stefanocoretta/tidymv
Choose a Base Repository
Nothing to show
base: v1.5.1
head repository: stefanocoretta/tidymv
Choose a Head Repository
Nothing to show
compare: v1.5.2
  • 2 commits
  • 7 files changed
  • 0 comments
  • 1 contributor
Showing with 23 additions and 15 deletions.
  1. +2 −2 DESCRIPTION
  2. +1 −0 NAMESPACE
  3. +6 −0 NEWS.md
  4. +11 −10 R/functions.R
  5. +1 −1 R/zzz.R
  6. +1 −1 README.md
  7. +1 −1 man/plot_difference.Rd
@@ -1,8 +1,8 @@
Package: tidymv
Type: Package
Title: Tidy Model Visualisation
Version: 1.5.1
Date: 2018-08-18
Version: 1.5.2
Date: 2018-10-22
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
@@ -7,4 +7,5 @@ export(plot_gamsd)
export(plot_smooths)
importFrom(magrittr,"%>%")
importFrom(rlang,":=")
importFrom(rlang,"quo_name")
importFrom(stats,"predict")
@@ -1,5 +1,9 @@
# Change Log

## [1.5.2] - 2018-10-22
### Fixed
- error with updated `rlang`

## [1.5.1] - 2018-08-18
### Added
- URL and BugReports in DESCRIPTION
@@ -81,6 +85,8 @@
- `create_start_event` function
- `plot_gamsd` function

[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
[1.4.0]: https://github.com/stefanocoretta/tidymv/compare/v1.3.1...v1.4.0
[1.3.1]: https://github.com/stefanocoretta/tidymv/compare/v1.3.0...v1.3.1
@@ -35,7 +35,7 @@ create_event_start <- function(tibble, event_col) {
#' @export
get_gam_predictions <- function(model, time_series, series_length = 25, conditions = NULL, exclude_random = TRUE, exclude_terms = NULL, split = NULL, sep = "\\.") {
time_series_q <- dplyr::enquo(time_series)
time_series_name <- dplyr::quo_name(time_series_q)
time_series_name <- rlang::quo_name(time_series_q)
outcome_q <- model$formula[[2]]

fitted <- model$model
@@ -78,7 +78,7 @@ get_gam_predictions <- function(model, time_series, series_length = 25, conditio

fitted_series <- fitted_series %>%
dplyr::mutate(
!!dplyr::quo_name(time_series_q) := rep(
!!rlang::quo_name(time_series_q) := rep(
list(seq(time_series_min, time_series_max, length.out = series_length)),
nrow(fitted_series)
)
@@ -202,16 +202,17 @@ get_gam_predictions <- function(model, time_series, series_length = 25, conditio
#'
#' @importFrom magrittr "%>%"
#' @importFrom rlang ":="
#' @importFrom rlang "quo_name"
#' @importFrom stats "predict"
#' @export
plot_smooths <- function(model, time_series, comparison = NULL, facet_terms = NULL, conditions = NULL, exclude_random = TRUE, exclude_terms = NULL, series_length = 25, split = NULL, sep = "\\.") {
time_series_q <- dplyr::enquo(time_series)
comparison_q <- dplyr::enquo(comparison)
facet_terms_q <- dplyr::enquo(facet_terms)
if (comparison_q == dplyr::quo(NULL)) {
if (rlang::quo_is_null(comparison_q)) {
comparison_q <- NULL
}
if (facet_terms_q == dplyr::quo(NULL)) {
if (rlang::quo_is_null(facet_terms_q)) {
facet_terms_q <- NULL
}
outcome_q <- model$formula[[2]]
@@ -221,15 +222,15 @@ plot_smooths <- function(model, time_series, comparison = NULL, facet_terms = NU
smooths_plot <- predicted_tbl %>%
ggplot2::ggplot(
ggplot2::aes_string(
dplyr::quo_name(time_series_q), dplyr::quo_name(outcome_q)
rlang::quo_name(time_series_q), rlang::quo_name(outcome_q)
)
) +
{if (!is.null(comparison_q)) {
ggplot2::geom_ribbon(
ggplot2::aes_string(
ymin = "CI_lower",
ymax = "CI_upper",
fill = dplyr::quo_name(comparison_q)
fill = rlang::quo_name(comparison_q)
),
alpha = 0.2
)
@@ -246,8 +247,8 @@ plot_smooths <- function(model, time_series, comparison = NULL, facet_terms = NU
{if (!is.null(comparison_q)) {
ggplot2::geom_path(
ggplot2::aes_string(
colour = dplyr::quo_name(comparison_q),
linetype = dplyr::quo_name(comparison_q)
colour = rlang::quo_name(comparison_q),
linetype = rlang::quo_name(comparison_q)
)
)
}} +
@@ -406,7 +407,7 @@ plot_gamsd <- function(model, view, comparison, conditions = NULL, rm_re = FALSE
#' @export
plot_difference <- function(model, time_series, difference, conditions = NULL, series_length = 100) {
time_series_q <- dplyr::enquo(time_series)
time_series_chr <- quo_name(time_series_q)
time_series_chr <- rlang::quo_name(time_series_q)

fitted <- model$model

@@ -437,7 +438,7 @@ plot_difference <- function(model, time_series, difference, conditions = NULL, s
diff_plot <- diff %>%
ggplot2::ggplot(
ggplot2::aes_string(
dplyr::quo_name(time_series_q), "difference"
rlang::quo_name(time_series_q), "difference"
)
) +
{if (is_sig) {annotate}} +
@@ -1 +1 @@
utils::globalVariables(c("fit", "se.fit"))
utils::globalVariables(c("CI", "fit", "geom_hline", "se.fit"))
@@ -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.1", 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.2", 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)`.

Some generated files are not rendered by default. Learn more.

No commit comments for this range

You can’t perform that action at this time.