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: v0.1.0
head repository: stefanocoretta/tidymv
Choose a Head Repository
Nothing to show
compare: v1.0.0
  • 7 commits
  • 5 files changed
  • 0 comments
  • 1 contributor
Showing with 52 additions and 31 deletions.
  1. +2 −2 DESCRIPTION
  2. +13 −1 NEWS.md
  3. +18 −28 R/functions.R
  4. +8 −0 R/tidymv.R
  5. +11 −0 man/tidymv.Rd
@@ -1,8 +1,8 @@
Package: tidymv
Type: Package
Title: Tidy Model Visualisation
Version: 0.1.0
Authors@R: person("Stefano", "Coretta", email = "stefano.coretta@gmail.com",
Version: 1.0.0
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
tools from the tidyverse.
14 NEWS.md
@@ -1,6 +1,18 @@
# Change Log

## 0.1.0
## [1.0.0] - 2017-10-21
### Added
- documentation of package

### Changed
- use `lag()` for `create_event_start()`

### Fixed
- error in `plot_gamsd` about missing xmin and xmax in annotate if there is no difference

## 0.1.0 - 2017-06-29
### Added
- `create_start_event` function
- `plot_gamsd` function

[1.0.0]: https://github.com/stefanocoretta/tidymv/compare/v0.1.0...v1.0.0
@@ -9,24 +9,14 @@
#'
#' @export
create_event_start <- function(tibble, event.col) {
event <- as.character(tibble[[event.col]])
previous <- ""
event.start <- NULL

for (i in 1:length(event)) {
current <- event[i]
if (current == previous) {
event.start.current <- FALSE
} else {
event.start.current <- TRUE
}

previous <- current

event.start <- c(event.start, event.start.current)
}

dplyr::mutate(tibble, start.event = event.start)
dplyr::mutate(
tibble,
start.event = ifelse(
as.character(tibble[[event.col]]) == lag(as.character(tibble[[event.col]]), default = FALSE),
FALSE,
TRUE
)
)
}


@@ -73,15 +63,19 @@ plot_gamsd <- function(model, view, comparison, conditions = NULL) {
fit <- "fit"
comp.column <- names(comparison)

annotate <- ggplot2::annotate(
"rect",
xmin=sig.diff$start, xmax=sig.diff$end,
ymin=-Inf, ymax=Inf, alpha=0.1, fill="red"
)

is.sig <- is.null(sig.diff) == FALSE

smooth.plot <- smooth.df %>%
ggplot2::ggplot(
ggplot2::aes_string(view, fit)
) +
ggplot2::annotate(
"rect",
xmin=sig.diff$start, xmax=sig.diff$end,
ymin=-Inf, ymax=Inf, alpha=0.1, fill="red"
) +
{if (is.sig) {annotate}} +
ggplot2::geom_ribbon(
ggplot2::aes(ymin = ymin.sm,
ymax = ymax.sm,
@@ -113,11 +107,7 @@ plot_gamsd <- function(model, view, comparison, conditions = NULL) {
ggplot2::aes_string(view, est)
) +
ggplot2::geom_hline(yintercept = 0, size = 0.3) +
ggplot2::annotate(
"rect",
xmin=sig.diff$start, xmax=sig.diff$end,
ymin=-Inf, ymax=Inf, alpha=0.1, fill="red"
) +
{if (is.sig) {annotate}} +
ggplot2::geom_ribbon(
ggplot2::aes(
ymin = ymin.di,
@@ -0,0 +1,8 @@
#' tidymv: Tidy Model Visualisation.
#'
#' This package provides functions for model visualisation using tidy tools from
#' the tidyverse.
#'
#' @docType package
#' @name tidymv
NULL

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.