From 3f365cd2646d8e1f8ecba0ab0ef0cddd093e5cb0 Mon Sep 17 00:00:00 2001 From: davidhodge931 Date: Tue, 10 Dec 2024 06:57:27 +1300 Subject: [PATCH] rename to gg_ribbon_line --- NAMESPACE | 2 +- NEWS.md | 2 +- R/gg_blanket.R | 8 ++--- R/{gg_lineribbon.R => gg_ribbon_line.R} | 4 +-- README.Rmd | 1 - README.md | 1 - man/{gg_lineribbon.Rd => gg_ribbon_line.Rd} | 10 +++---- .../testthat/_snaps/article-go-further/5.svg | 10 +++---- .../testthat/_snaps/article-go-further/6.svg | 4 +-- .../testthat/_snaps/vignette-ggblanket/16.svg | 6 ++-- .../testthat/_snaps/vignette-ggblanket/17.svg | 22 +++++++------- .../{test-lineribbon.R => test-ribbon-line.R} | 2 +- tests/testthat/test-vignette-ggblanket.R | 2 -- vignettes/articles/1_demo_light.Rmd | 30 +++++++++---------- vignettes/articles/2_demo_dark.Rmd | 30 +++++++++---------- 15 files changed, 65 insertions(+), 69 deletions(-) rename R/{gg_lineribbon.R => gg_ribbon_line.R} (99%) rename man/{gg_lineribbon.Rd => gg_ribbon_line.Rd} (98%) rename tests/testthat/{test-lineribbon.R => test-ribbon-line.R} (97%) diff --git a/NAMESPACE b/NAMESPACE index 0d0795e03..caa0754ae 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -27,7 +27,6 @@ export(gg_jitter) export(gg_label) export(gg_line) export(gg_linerange) -export(gg_lineribbon) export(gg_path) export(gg_point) export(gg_pointrange) @@ -37,6 +36,7 @@ export(gg_quantile) export(gg_raster) export(gg_rect) export(gg_ribbon) +export(gg_ribbon_line) export(gg_rug) export(gg_segment) export(gg_sf) diff --git a/NEWS.md b/NEWS.md index f6c3bbd3c..f44e3f38f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,7 @@ * Removed `aes_colour_darken`, `aes_colour_lighten`, `aes_fill_darken` and `aes_colour_lighten`. * Removed `gg_ribbon`, `gg_boxplot`, `gg_crossbar` and `gg_smooth` alpha default to `NA`. * Added colour blending (e.g. `blend = "multiply`). -* Added `gg_lineribbon`. +* Added `gg_ribbon_line`. * Updated `*_mode_*` themes to default to `axis_line_linewidth = 0.25`. # ggblanket 11.0.0 diff --git a/R/gg_blanket.R b/R/gg_blanket.R index 86288fc3e..bae11d7f6 100644 --- a/R/gg_blanket.R +++ b/R/gg_blanket.R @@ -245,7 +245,7 @@ gg_blanket <- function(data = NULL, stat = stat, position = position, mapping = ggplot2::aes(!!!mapping), - params = rlang::list2(outlier.alpha = 1, ...), + params = rlang::list2(...), show.legend = show_legend, ) + coord @@ -257,7 +257,7 @@ gg_blanket <- function(data = NULL, stat = stat, position = position, mapping = ggplot2::aes(!!!mapping), - params = rlang::list2(outlier.alpha = 1, ...), + params = rlang::list2(...), show.legend = show_legend, ) |> ggblend::blend(blend = blend) + coord @@ -464,7 +464,7 @@ gg_blanket <- function(data = NULL, stat = stat, position = position, mapping = ggplot2::aes(!!!mapping), - params = rlang::list2(outlier.alpha = 1, ...), + params = rlang::list2(...), show.legend = show_legend, ) + coord @@ -476,7 +476,7 @@ gg_blanket <- function(data = NULL, stat = stat, position = position, mapping = ggplot2::aes(!!!mapping), - params = rlang::list2(outlier.alpha = 1, ...), + params = rlang::list2(...), show.legend = show_legend, ) |> ggblend::blend(blend = blend) + coord diff --git a/R/gg_lineribbon.R b/R/gg_ribbon_line.R similarity index 99% rename from R/gg_lineribbon.R rename to R/gg_ribbon_line.R index d28f7183d..c1022b758 100644 --- a/R/gg_lineribbon.R +++ b/R/gg_ribbon_line.R @@ -15,7 +15,7 @@ #' #' data.frame(year = 1875:1972, level = as.vector(LakeHuron)) |> #' mutate(level_min = level - 1, level_max = level + 1) |> -#' gg_lineribbon( +#' gg_ribbon_line( #' x = year, #' y = level, #' ymin = level_min, @@ -24,7 +24,7 @@ #' blend = "multiply", #' ) #' -gg_lineribbon <- function(data = NULL, +gg_ribbon_line <- function(data = NULL, ..., stat = "identity", position = "identity", diff --git a/README.Rmd b/README.Rmd index 79b37a3be..de60d929a 100644 --- a/README.Rmd +++ b/README.Rmd @@ -25,7 +25,6 @@ knitr::opts_chunk$set( [![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/last-month/ggblanket?color=lightgrey)](https://r-pkg.org/pkg/ggblanket) [![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/last-week/ggblanket?color=lightgrey)](https://r-pkg.org/pkg/ggblanket) [![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/last-day/ggblanket?color=lightgrey)](https://r-pkg.org/pkg/ggblanket) -[![R-CMD-check](https://github.com/davidhodge931/ggblanket/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/davidhodge931/ggblanket/actions/workflows/R-CMD-check.yaml) ## Overview diff --git a/README.md b/README.md index bdb2aacc6..0c1165b8f 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ downloads](https://cranlogs.r-pkg.org/badges/last-month/ggblanket?color=lightgre downloads](https://cranlogs.r-pkg.org/badges/last-week/ggblanket?color=lightgrey)](https://r-pkg.org/pkg/ggblanket) [![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/last-day/ggblanket?color=lightgrey)](https://r-pkg.org/pkg/ggblanket) -[![R-CMD-check](https://github.com/davidhodge931/ggblanket/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/davidhodge931/ggblanket/actions/workflows/R-CMD-check.yaml) ## Overview diff --git a/man/gg_lineribbon.Rd b/man/gg_ribbon_line.Rd similarity index 98% rename from man/gg_lineribbon.Rd rename to man/gg_ribbon_line.Rd index 3d7831b49..29efbc03a 100644 --- a/man/gg_lineribbon.Rd +++ b/man/gg_ribbon_line.Rd @@ -1,10 +1,10 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/gg_lineribbon.R -\name{gg_lineribbon} -\alias{gg_lineribbon} +% Please edit documentation in R/gg_ribbon_line.R +\name{gg_ribbon_line} +\alias{gg_ribbon_line} \title{Lineribbon ggplot} \usage{ -gg_lineribbon( +gg_ribbon_line( data = NULL, ..., stat = "identity", @@ -169,7 +169,7 @@ set_blanket() data.frame(year = 1875:1972, level = as.vector(LakeHuron)) |> mutate(level_min = level - 1, level_max = level + 1) |> - gg_lineribbon( + gg_ribbon_line( x = year, y = level, ymin = level_min, diff --git a/tests/testthat/_snaps/article-go-further/5.svg b/tests/testthat/_snaps/article-go-further/5.svg index 99cbb992c..499334a1b 100644 --- a/tests/testthat/_snaps/article-go-further/5.svg +++ b/tests/testthat/_snaps/article-go-further/5.svg @@ -31,14 +31,14 @@ - - - + + + - + @@ -63,7 +63,7 @@ - + diff --git a/tests/testthat/_snaps/article-go-further/6.svg b/tests/testthat/_snaps/article-go-further/6.svg index 60d363a12..81a258bf7 100644 --- a/tests/testthat/_snaps/article-go-further/6.svg +++ b/tests/testthat/_snaps/article-go-further/6.svg @@ -31,8 +31,8 @@ - - + + diff --git a/tests/testthat/_snaps/vignette-ggblanket/16.svg b/tests/testthat/_snaps/vignette-ggblanket/16.svg index 654b4306d..9f610c332 100644 --- a/tests/testthat/_snaps/vignette-ggblanket/16.svg +++ b/tests/testthat/_snaps/vignette-ggblanket/16.svg @@ -33,17 +33,17 @@ - + - + - + Gentoo diff --git a/tests/testthat/_snaps/vignette-ggblanket/17.svg b/tests/testthat/_snaps/vignette-ggblanket/17.svg index dc369d44d..376e1db4a 100644 --- a/tests/testthat/_snaps/vignette-ggblanket/17.svg +++ b/tests/testthat/_snaps/vignette-ggblanket/17.svg @@ -36,37 +36,37 @@ - + - + - + - + - + - + - + - + 170 @@ -99,17 +99,17 @@ - + - + - + female male diff --git a/tests/testthat/test-lineribbon.R b/tests/testthat/test-ribbon-line.R similarity index 97% rename from tests/testthat/test-lineribbon.R rename to tests/testthat/test-ribbon-line.R index 9c9e8d8f0..3e43b10da 100644 --- a/tests/testthat/test-lineribbon.R +++ b/tests/testthat/test-ribbon-line.R @@ -23,7 +23,7 @@ test_that(test_name, { h = c(one + 1, two + 1), id = rep(c("one", "two"), each = 10) ) |> - gg_lineribbon( + gg_ribbon_line( x = x, y = y, ymin = l, diff --git a/tests/testthat/test-vignette-ggblanket.R b/tests/testthat/test-vignette-ggblanket.R index d223dde56..d99afa69f 100644 --- a/tests/testthat/test-vignette-ggblanket.R +++ b/tests/testthat/test-vignette-ggblanket.R @@ -326,7 +326,6 @@ test_that(test_name, { x = flipper_length_mm, y = species, position = position_dodge2(preserve = "single"), - alpha = 0, ) vdiffr::expect_doppelganger(test_name, p) @@ -344,7 +343,6 @@ test_that(test_name, { y = flipper_length_mm, col = sex, position = position_dodge2(preserve = "single"), - alpha = 0, ) vdiffr::expect_doppelganger(test_name, p) diff --git a/vignettes/articles/1_demo_light.Rmd b/vignettes/articles/1_demo_light.Rmd index 2f366290a..5b70197c6 100644 --- a/vignettes/articles/1_demo_light.Rmd +++ b/vignettes/articles/1_demo_light.Rmd @@ -295,21 +295,6 @@ economics |> ) ``` -### gg_lineribbon - -```{r} -data.frame(year = 1875:1972, level = as.vector(LakeHuron)) |> - mutate(level_min = level - 1, level_max = level + 1) |> - gg_lineribbon( - x = year, - y = level, - ymin = level_min, - ymax = level_max, - x_labels = \(x) x, - blend = "multiply", - ) -``` - ### gg_linerange ```{r} @@ -464,6 +449,21 @@ data.frame(year = 1875:1972, level = as.vector(LakeHuron)) |> ) ``` +### gg_ribbon_line + +```{r} +data.frame(year = 1875:1972, level = as.vector(LakeHuron)) |> + mutate(level_min = level - 1, level_max = level + 1) |> + gg_ribbon_line( + x = year, + y = level, + ymin = level_min, + ymax = level_max, + x_labels = \(x) x, + blend = "multiply", + ) +``` + ### gg_rug ```{r} diff --git a/vignettes/articles/2_demo_dark.Rmd b/vignettes/articles/2_demo_dark.Rmd index 71d4963e5..94bf94902 100644 --- a/vignettes/articles/2_demo_dark.Rmd +++ b/vignettes/articles/2_demo_dark.Rmd @@ -302,21 +302,6 @@ economics |> ) ``` -### gg_lineribbon - -```{r} -data.frame(year = 1875:1972, level = as.vector(LakeHuron)) |> - mutate(level_min = level - 1, level_max = level + 1) |> - gg_lineribbon( - x = year, - y = level, - ymin = level_min, - ymax = level_max, - x_labels = \(x) x, - blend = "multiply", - ) -``` - ### gg_linerange ```{r} @@ -471,6 +456,21 @@ data.frame(year = 1875:1972, level = as.vector(LakeHuron)) |> ) ``` +### gg_ribbon_line + +```{r} +data.frame(year = 1875:1972, level = as.vector(LakeHuron)) |> + mutate(level_min = level - 1, level_max = level + 1) |> + gg_ribbon_line( + x = year, + y = level, + ymin = level_min, + ymax = level_max, + x_labels = \(x) x, + blend = "multiply", + ) +``` + ### gg_rug ```{r}