arrow icon indicating copy to clipboard operation
arrow copied to clipboard

Hyperbolic trigonometry functions

Open andersen-hecon opened this issue 1 year ago • 1 comments

Describe the enhancement requested

In economics and health services research we often use hyperbolic trig functions--particularly the hyperbolic arc sine function--to transform skewed data with 0s. While it is possible (and not too difficult) to code up asinh manually (ln(x+sqrt(x^2+1))), it would be great if it could be added to the library of built-in functions.

Component(s)

R

andersen-hecon avatar Oct 10 '24 19:10 andersen-hecon

Hi @andersen-hecon - thanks for opening this issue! Would you be interested in submitting a pull request?

thisisnic avatar Oct 12 '24 17:10 thisisnic

Tbh not sure how to do that! (Very new to GitHub etc)

andersen-hecon avatar Oct 24 '24 15:10 andersen-hecon

I took a stab at this in #44630 . (If I understand how the R build works, this will magically add the R functions as well, but correct me if I'm wrong @thisisnic )

khwilson avatar Nov 03 '24 20:11 khwilson

Thanks for making that PR @khwilson, that's awesome!! I won't review it myself as I'm not super familiar with the C++ side but I've pinged someone who can.

I'm afraid it won't magically add the R functions as well, but here's a guide on how to do that from an older version of the docs: https://arrow.apache.org/docs/dev/r/articles/developers/bindings.html

thisisnic avatar Nov 11 '24 17:11 thisisnic

Ah disappointing! Not quite like the Python version then.

khwilson avatar Nov 11 '24 21:11 khwilson

Thank you for the PR @khwilson. I added my review. It's very comprehensive and well done (with the right _checked variations and all). I created a separate issue so that we can focus on merging this PR as soon as possible and another one can be opened dedicated to adding the R bindings (pointing to this issue).

felipecrv avatar Dec 05 '24 14:12 felipecrv

@khwilson's PR is now merged. R bindings still pending so this issue remains open.

felipecrv avatar Dec 09 '24 22:12 felipecrv

Thanks for pushing this through @felipecrv!

thisisnic avatar May 01 '25 13:05 thisisnic

Implemented in https://github.com/apache/arrow/pull/44971

thisisnic avatar Jun 16 '25 11:06 thisisnic