Skip to content

Commit

Permalink
documentation of new warning message in ggplot2 v2.2.0 and how to avo…
Browse files Browse the repository at this point in the history
…id. Add test to ensure method to avoid warning works
  • Loading branch information
wmurphyrd committed Nov 1, 2016
1 parent 2302bbe commit 059df35
Show file tree
Hide file tree
Showing 13 changed files with 70 additions and 43 deletions.
21 changes: 7 additions & 14 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
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 = "[email protected]",
role = c("aut", "cre")),
person("Hadley", "Wickham", role = "ctb",
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:
Expand All @@ -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 <http://
www.gnu.org/licenses/>.
Copyright: Copyright 2016 William Murphy
VignetteBuilder: knitr
URL: https://github.com/wmurphyrd/colorplaner
BugReports: https://github.com/wmurphyrd/colorplaner/issues
Expand Down
6 changes: 3 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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`

17 changes: 17 additions & 0 deletions R/colorplaner.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 6 additions & 16 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Binary file modified figure/colorplane-advanced-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figure/colorplane-basics-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figure/colorplane-interpretation-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified figure/intro-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions man/colorplaner.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand All @@ -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
Expand All @@ -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`

Expand Down
Binary file modified tests/testthat/Rplots.pdf
Binary file not shown.
11 changes: 11 additions & 0 deletions tests/testthat/test_complex_plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
))
})
5 changes: 3 additions & 2 deletions vignettes/colorplaner.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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) +
Expand Down

0 comments on commit 059df35

Please sign in to comment.