Skip to content
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

Doc: scale_y_continous(transform = "asn") badly/wrongly documented #6154

Closed
LGraz opened this issue Oct 22, 2024 · 1 comment
Closed

Doc: scale_y_continous(transform = "asn") badly/wrongly documented #6154

LGraz opened this issue Oct 22, 2024 · 1 comment

Comments

@LGraz
Copy link

LGraz commented Oct 22, 2024

scale_y_continuous(transform = "asn") uses the arcsin transformation (c.f. transform_asn())

?scale_y_continuous() does not give any information further info about "asn"

Hadley's old book claims that "asn" refers to the $tanh$-function (c.f. https://bookdown.dongzhuoer.com/hadley/ggplot2-book/scale-transformation ). Note that it is only one of the only resoureces I found that document what "asn" does.

Suggestion:

  • correct the book (if you guys have the power)
  • indicate on the helppage ?scale_y_continuous() that asn is the arcsin (this wasnt clear to me, who studied mathematics ^^)
@teunbrand
Copy link
Collaborator

I don't think it is a 'plain' arcsin either. The transformation and its inverse are defined here:

https://github.com/r-lib/scales/blob/fda519e2ac0828048c24f3c2b254c2607f75ac5c/R/transform-numeric.R#L12-L13

The transformation itself is from the {scales} package and documented in ?scales::transform_asn(). If there is an issue with the documentation, you can file an issue here: https://github.com/r-lib/scales/issues.

The current book can be found here: https://ggplot2-book.org/scales-position#sec-scale-transformation. Issues with the book can be filed here: https://github.com/hadley/ggplot2-book/issues.

In any case, I think the documentation of ggplot2 suffices: the ?scale_y_continuous() docs points to the scales::transform_*() functions and to the 'Numeric position scales' chapter of the book. I doesn't in itself document the asn transformation. As I don't think there is anything to improve for ggplot2, I'll close this issue.

@teunbrand teunbrand closed this as not planned Won't fix, can't repro, duplicate, stale Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants