diff --git a/DESCRIPTION b/DESCRIPTION index 5c9f20b..c81ccab 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,9 +1,9 @@ Package: colorplaner Type: Package -Title: A ggplot2 Extension to Visualize Two Variables per Color Aesthetic +Title: A 'ggplot2' Extension to Visualize Two Variables per Color Aesthetic Through Color Space Projections -Version: 0.1.2.9000 -Date: 2016-10-02 +Version: 0.1.3 +Date: 2016-10-31 Authors@R: c(person("William", "Murphy", email = "william.murphy.rd@gmail.com", role = c("aut", "cre")), @@ -11,11 +11,11 @@ Authors@R: c(person("William", "Murphy", comment = "Original author for copied and derived code"), person("Winston", "Chang", role = "ctb", comment = "Original author for copied and derived code")) -Description: A ggplot2 extension to visualize two +Description: A 'ggplot2' extension to visualize two variables through one color aesthetic via mapping to a color space projection. With this technique for 2-D color mapping, one can create a - dichotomous choropleth in R as well as other visualizations with - bivariate color scales. Includes two new scales and a new guide for ggplot2. + bivariate choropleth in R as well as other visualizations with multivariate + color scales. Includes two new scales and a new guide for 'ggplot2'. License: GPL-2 LazyData: TRUE Imports: @@ -34,14 +34,7 @@ Suggests: rmarkdown, covr RoxygenNote: 5.0.1 -Copyright: Copyright 2016 William Murphy. colorplaner is free software: you - can redistribute it and/or modify it under the terms of the GNU General Public - License as published by the Free Software Foundation,version 2. This program is distributed - in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - the GNU General Public License for more details. You should have received a copy - of the GNU General Public License along with this program. If not, see . +Copyright: Copyright 2016 William Murphy VignetteBuilder: knitr URL: https://github.com/wmurphyrd/colorplaner BugReports: https://github.com/wmurphyrd/colorplaner/issues diff --git a/NEWS.md b/NEWS.md index 82f0f34..4e637f4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ -# Version 0.1.2.9000 (devel) +# Version 0.1.3 * Change tests to compensate for ggplot2 2.2.0 changes -* Due to ggplot2 2.2.0 changes, mapping a colorplane at the level of an individual layer will now produce a false warning messsage, but full functionality remains intact +* Due to ggplot2 2.2.0 changes, mapping a colorplane at the level of an individual layer will now produce a warning message, but functions normally. See `?colorplaner` for more information. # Version 0.1.2 * Fixed an issue that was preventing updated vignettes from building @@ -9,7 +9,7 @@ now included # Version 0.1.1 * Initial release of the colorplaner package -* Implements two new gglot2 scales: `scale_color_colorplane` and +* Implements two new ggplot2 scales: `scale_color_colorplane` and `scale_fill_colorplane` * Implements one new ggplot2 guide: `guide_colorplane` diff --git a/R/colorplaner.R b/R/colorplaner.R index df27c14..699788b 100644 --- a/R/colorplaner.R +++ b/R/colorplaner.R @@ -37,6 +37,23 @@ #' Check \url{https://github.com/wmurphyrd/colorplaner/issues/27} for current #' status and progress towards resolving this issue. #' +#' @section Warning Message About Ignoring Unknown Aesthetics: +#' Layers now produce a warning message when unrecognized aesthetics are found +#' but have no mechanism for notifying them of aesthetics handled by scales. +#' The warning can be avoided by mapping \code{color2}/\code{fill2} at the plot +#' level (i.e. in the initial \code{ggplot()} statement). If you want to avoid +#' colorplane mapping on all layers, map \code{color}/\code{fill} only on the +#' layers you want, as in the example below. +#' +#' @examples +#' library(ggplot2) +#' ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, +#' colour2 = Petal.Width)) + +#' geom_point(aes(colour = Petal.Length)) + +#' geom_line(aes(linetype = Species)) + +#' scale_color_colorplane() +#' +#' #' @name colorplaner #' @import ggplot2 #' @importFrom scales rescale diff --git a/cran-comments.md b/cran-comments.md index fb216f0..312f76d 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,19 +1,9 @@ -## Request for Early Update -This a request to update the colorplaner package shortly after initial -publication. - -I am requesting this update because the published package contains -incomplete versions of the package vignettes. This occurred because I had -inadvertently left files in /inst/docs/ from previous test building of vignettes -and was unaware that this would prevent the current vignettes from being -built. - -I have submitted a pull request for the devtools package to -add a check for this mistake to prevent it from happening to others: -https://github.com/hadley/devtools/pull/1362 - -I apologize for the inefficient use of CRAN volunteer and server resources. -Thank you for considering this early update. +## Update Due To Upstream Dependency Changes +Hello. Sorry for another update request so soon, but I received a downstream +depenency failure message, as changes in ggplot2 v2.2.0 +were causing this package's build to fail. +Also made some minor changes to DESCRIPTION Description and Copyright fields +based on feedback from Uwe on a submission for a different package. ## Test environments * local Windows 10 install, R 3.3.1 diff --git a/figure/colorplane-advanced-1.png b/figure/colorplane-advanced-1.png index cfc2503..c832530 100644 Binary files a/figure/colorplane-advanced-1.png and b/figure/colorplane-advanced-1.png differ diff --git a/figure/colorplane-basics-2.png b/figure/colorplane-basics-2.png index 40322e3..48835af 100644 Binary files a/figure/colorplane-basics-2.png and b/figure/colorplane-basics-2.png differ diff --git a/figure/colorplane-interpretation-1.png b/figure/colorplane-interpretation-1.png index 2b9cb2b..84d27cc 100644 Binary files a/figure/colorplane-interpretation-1.png and b/figure/colorplane-interpretation-1.png differ diff --git a/figure/intro-1.png b/figure/intro-1.png index fdb416d..98d1f6f 100644 Binary files a/figure/intro-1.png and b/figure/intro-1.png differ diff --git a/man/colorplaner.Rd b/man/colorplaner.Rd index 5e1b7cf..f5e426a 100644 --- a/man/colorplaner.Rd +++ b/man/colorplaner.Rd @@ -29,3 +29,23 @@ Check \url{https://github.com/wmurphyrd/colorplaner/issues/27} for current status and progress towards resolving this issue. } +\section{Warning Message About Ignoring Unknown Aesthetics}{ + +Layers now produce a warning message when unrecognized aesthetics are found +but have no mechanism for notifying them of aesthetics handled by scales. +The warning can be avoided by mapping \code{color2}/\code{fill2} at the plot +level (i.e. in the initial \code{ggplot()} statement). If you want to avoid +colorplane mapping on all layers, map \code{color}/\code{fill} only on the +layers you want, as in the example below. +} +\examples{ +library(ggplot2) +ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, + colour2 = Petal.Width)) + + geom_point(aes(colour = Petal.Length)) + + geom_line(aes(linetype = Species)) + + scale_color_colorplane() + + +} + diff --git a/readme.md b/readme.md index 652c937..12228c2 100644 --- a/readme.md +++ b/readme.md @@ -12,11 +12,6 @@ The colorplaner R package is a ggplot2 extension to visualize two variables through one color aesthetic via mapping to a color space projection. With this technique for 2-D color mapping, one can create a dichotomous choropleth in R as well as other visualizations with bivariate color scales. The extension implements two new scales, `scale_color_colorplane` and `scale_fill_colorplane`, two new aesthetics, `color2` and `fill2`, and a new guide `guide_colorplane`. - -``` -## Warning: Ignoring unknown aesthetics: color2 -``` - ![Example use of colorplane with the iris dataset.](figure/intro-1.png) @@ -32,9 +27,9 @@ install.packages("colorplaner") devtools::install_github("wmurphyrd/colorplaner") ``` -#### Version 0.1.2.9000 (devel) +#### Version 0.1.3 * Change tests to compensate for ggplot2 2.2.0 changes -* Due to ggplot2 2.2.0 changes, mapping a colorplane at the level of an individual layer will now produce a false warning messsage, but full functionality remains intact +* Due to ggplot2 2.2.0 changes, mapping a colorplane at the level of an individual layer will now produce a warning message, but functions normally. See `?colorplaner` for more information. #### Version 0.1.2 * Fixed an issue that was preventing updated vignettes from building @@ -43,7 +38,7 @@ now included #### Version 0.1.1 * Initial release of the colorplaner package -* Implements two new gglot2 scales: `scale_color_colorplane` and +* Implements two new ggplot2 scales: `scale_color_colorplane` and `scale_fill_colorplane` * Implements one new ggplot2 guide: `guide_colorplane` diff --git a/tests/testthat/Rplots.pdf b/tests/testthat/Rplots.pdf index 56a2b7b..7d5bfbb 100644 Binary files a/tests/testthat/Rplots.pdf and b/tests/testthat/Rplots.pdf differ diff --git a/tests/testthat/test_complex_plots.R b/tests/testthat/test_complex_plots.R index 51546b7..03d0d73 100644 --- a/tests/testthat/test_complex_plots.R +++ b/tests/testthat/test_complex_plots.R @@ -47,3 +47,14 @@ test_that("Multiple data layer plots", { ggtitle("Points over histogram, petal width > 1, length > 3") )) }) + +test_that("Colorplane only on some layers without warning", { + expect_silent(print( + ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, + colour2 = Petal.Width)) + + geom_point(aes(colour = Petal.Length)) + + geom_line(aes(linetype = Species)) + + scale_color_colorplane() + + ggtitle("Colorplane points with black lines") + )) +}) diff --git a/vignettes/colorplaner.Rmd b/vignettes/colorplaner.Rmd index 8b3aff0..6438511 100644 --- a/vignettes/colorplaner.Rmd +++ b/vignettes/colorplaner.Rmd @@ -161,8 +161,9 @@ iris_plot %+% iris[iris$labeled, ] + theme(legend.position = "bottom", legend.text = element_text(size = 8), legend.key.width = grid::unit(3, "mm")) -ggplot(sepal_grid, aes(x = Sepal.Length, y = Sepal.Width)) + - geom_point(aes(color = Sepal.Length, color2 = Sepal.Width), size = 5) + +ggplot(sepal_grid, aes(x = Sepal.Length, y = Sepal.Width, + color2 = Sepal.Width)) + + geom_point(aes(color = Sepal.Length), size = 5) + geom_point(aes(shape = Species), data = iris[iris$labeled, ], size = 1.5) + geom_text(aes(label = let), data = iris[iris$labeled, ], nudge_x = .14, nudge_y = -.04) +