HenrikBengtsson / Wishlist-for-R

Features and tweaks to R that I and others would love to see - feel free to add yours!
https://github.com/HenrikBengtsson/Wishlist-for-R/issues
GNU Lesser General Public License v3.0
134 stars 4 forks source link

WISH: faster `range()` function #167

Open m-muecke opened 4 months ago

m-muecke commented 4 months ago

The current range() function calls R's min and max instead of doing the range call in C with a single loop. Just rewriting the https://github.com/r-devel/r-svn/blob/0211b7df7d3093cf1a7da167f70a855f5181a950/src/library/base/R/range.R#L28 part with cpp11 gave me 1.5-2x improvement.