New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change behaviour of theme_update to be more like an update #1519

Merged
merged 7 commits into from Feb 4, 2016

Conversation

Projects
None yet
2 participants
@oneillkza

oneillkza commented Jan 25, 2016

Per discussion in #1489, this changes theme_update() to use the + operator, so that unspecified attributes of the element being set are taken from the current theme, rather than NULLing them out. I've added theme_replace() with the same behaviour as the current theme_update(), in case that behaviour is desired (though I'm hard-pressed to think of a use case).

I've also added some verbiage to the documentation clarifying what these do, along with examples.

koneill added some commits Jan 25, 2016

koneill
Change behaviour of theme_update to be more of an update, while addin…
…g theme_replace that has the same behaviour as the old theme_update. Also expanded and clarified the documentation for these.
@hadley

This comment has been minimized.

Member

hadley commented Jan 26, 2016

@wch do you remember the motivation for using %+replace% here?

R/theme.r Outdated
#' @export
theme_replace <- function(...) {
# Make a call to theme, then add to theme

This comment has been minimized.

@hadley

hadley Jan 31, 2016

Member

Can you please remove this comment? (and in the previous fun)

R/theme.r Outdated
#' @rdname theme_update
#' @export

This comment has been minimized.

@hadley

hadley Jan 31, 2016

Member

Please remove this empty line

@hadley

This comment has been minimized.

Member

hadley commented Jan 31, 2016

Looks good. Just a few minor tweaks and can you please add a bullet point to NEWS?

@hadley hadley modified the milestone: v2.1.0 Jan 31, 2016

koneill added some commits Feb 1, 2016

koneill
@oneillkza

This comment has been minimized.

oneillkza commented Feb 1, 2016

Done!

koneill
NEWS.md Outdated
@@ -1,5 +1,9 @@
# ggplot2 2.0.0.9000
* `theme_update()` now uses the `+` operator instead of `%+replace%`, so that
unspecified values will no longer be `NULL`ed out. `theme_replace()`
preserves the old behaviour if desired (#1519).

This comment has been minimized.

@hadley

hadley Feb 2, 2016

Member

Could you please cite your github user name in the brackets?

koneill
@oneillkza

This comment has been minimized.

oneillkza commented Feb 2, 2016

Done!

@hadley hadley merged commit 4b7fcbd into tidyverse:master Feb 4, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@hadley

This comment has been minimized.

Member

hadley commented Feb 4, 2016

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment