-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Feature/stefanedwards labeller #910
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
Feature/stefanedwards labeller #910
Conversation
These two functions aid when labelling facets. labeller allows for providing multiple named vectors and/or methods to change the labels for each margin. label_wrap_gen allows labels to be word wrapped.
This reverts commit 80794d8.
|
#' @seealso , \code{\link{labeller}} | ||
#' @examples | ||
#' set.seed(331) | ||
#' x=runif(60) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please follow http://adv-r.had.co.nz/Style.html? i.e. x <- runif(60)
. But I think this whole block could be done inside data.frame()
, or better, use an existing built-in dataframe.
`labeller` works while being refactored.
function(variable, values) { | ||
str(values) | ||
if (is.logical(values)) { | ||
values <- as.integer(values)+1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spaces around +
please
If you can make the suggested changes this week, you contribution will make it into the next version of ggplot2. |
Fixed stylebugs. Behaviour in labeller when passed a method has been simplified; now it 'guesses' how many arguments the method needs and absed on that attempts to pass either "values", or "variable" and "values". It's basically in the users hands now to provide a fitting method.
Do I need to do something else? I've uploaded my changes. |
#' @examples | ||
#' | ||
#' data(mpg) | ||
#' ggplot(mpg, aes(cty, hwy)) + geom_point() + facet_grid(cyl ~ class, labeller=label_both) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please wrap these lines?
Added a few more comments. All needs a paragraph in NEWS. Thanks! |
Wrapped lines. Removed dependency on Hmisc in example to labeller. Replaced sapply with vapply in label_wrap_gen.
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
1 similar comment
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
Resubmitting #904:
These two functions aid when labelling facets. labeller allows for
providing multiple named vectors and/or methods to change the labels for
each margin. label_wrap_gen allows labels to be word wrapped.