Skip to content

fix discrete_scale documentation #2055

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

Merged
merged 2 commits into from
Feb 27, 2017
Merged

fix discrete_scale documentation #2055

merged 2 commits into from
Feb 27, 2017

Conversation

alistaire47
Copy link
Contributor

Updates discrete_scale documentation to match functionality and continuous_scale to make it clear the labels parameter can accept a formatter function as shown in the last example of scale_x_discrete (fixes #2052).

No code changes; just literally coped and pasted the documentation of the labels parameter from continuous_scale, called devtools::document(), and updated NEWS.md per CONTRIBUTING.md (delete that if it's too minor for news!).

Updated `discrete_scale` documentation to match functionality and
`continuous_scale` (@alistaire47, $2052).
R/scale-.r Outdated
#' labels (labels the same as breaks), a character vector the same length
#' as breaks, or a named character vector whose names are used to match
#' replacement the labels for matching breaks.
#' @param labels One of: \itemize{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please use @inheritParams instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was putting this together but realized continuous_scale currently actually inherits parameters from discrete_scale, even though it has all its parameters defined anyway. They each have a couple unique parameters, so do you have a preference for which inherits from which?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. My general convention has been when there's a class of similar function, inherit documentation from the first in the alphabet, but it's not a big deal.

@alistaire47
Copy link
Contributor Author

The newest commit merges shared parameters into continuous_scale, using whichever was more comprehensive, and now discrete_scale inherits from that. I left distinct parameters and the separate explanation of na.value that relates to na.translate.

I also realized the explanations of the scale_name and name parameters is repetitive and unclear, but I don't know enough about the difference and how they behave to alter anything.

@hadley hadley merged commit 2dce982 into tidyverse:master Feb 27, 2017
@hadley
Copy link
Member

hadley commented Feb 27, 2017

Thanks!

Do you want to have a stab at clearing up name vs scale_name? scale_name is the name of the scale function like gradient2, brewer etc. name is the name of the scale applied to a specific plot. The user never sees scale_name so it's less important to document well (but it would be nice if it was less confusing)

@lock
Copy link

lock bot commented Jan 18, 2019

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/

@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs for discrete_scale inaccurate
2 participants