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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.