Note: This R package is not mean to be "serious". It's just for teaching purposes.
This is an R package that gives sqrt()
friends by providing other power functions. Update:
--> now, the package also supports Box Cox Transformations and Inverse
You can install powers from github with:
# install.packages("devtools")
devtools::install_github("dorawyy/powers")
See the vignette for more extensive use, but here's an example:
powers::reciprocal(2)
#> [1] 0.5
Here is an example for Box Cox transformation
powers::boxCox(1:10)
#> Warning in if ((x + y) < 0) return(NULL): the condition has length > 1 and
#> only the first element will be used
#> [1] 0.0000000 0.6931472 1.0986123 1.3862944 1.6094379 1.7917595 1.9459101
#> [8] 2.0794415 2.1972246 2.3025851
(Again, I don't actually intend for anyone to develop this silly package, but if I did, here's what I'd write.)
Use the internal pow
function as the machinery for the front-end functions such as square
, cube
, and reciprocal
.
Newly added Box Cox transformation/inverse related functions are: boxCox
, boxCox2
, and invBoxCox