Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.
/ powers Public archive
forked from vincenzocoia/powers

A silly toy R package to compute powers

License

Notifications You must be signed in to change notification settings

dorawyy/powers

 
 

Repository files navigation

Note: This R package is not mean to be "serious". It's just for teaching purposes.

powers

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

Installation

You can install powers from github with:

# install.packages("devtools")
devtools::install_github("dorawyy/powers")

Example

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

For Developers

(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

About

A silly toy R package to compute powers

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 77.1%
  • R 22.9%