This package is intended to help you compute powers. To use it load:

library(powers)

You can take the square of any vector.

square(2)

Or the cube.

cube(2)

Or an exponent of your choice!

pow(2,3)

The pow() function has a default exponent of 2.

pow(2)

These functions also work on logicals or vectors.

pow(c(1,2,3),2)

pow(c(TRUE, FALSE, TRUE),2)


KateJohnson/powers documentation built on May 29, 2019, 12:03 p.m.