Note: This package isn't actually meant to be "serious". It's simply made for STAT547 Homework 09.

Want to compute powers without having to use ^ or **? Give sqrt some friends by loading the powers package!

library(powers)

Want squares, cubes, quartics or reciprocals? Easy.

square(1:10)
cube(1:10)
quartic(1:10)
reciprocal(1:10)

apply-family friendly, too!

my_list <- list(1:10, 0.5, -0.7)
## So base-R-boring!
lapply(my_list, function(x) x^2)
## Use powers instead!
lapply(my_list, square)

It even comes with the ability to display its output in plot form!

reciprocal(1:10, plot_it=TRUE)

Need to use powers in a geometric formula? You can quickly calculate the area of a circle and volume of a cylinder!

areacircle(1:10)
volcyl(2, 6)

It can also handle non-numeric values and drop NA(s)!

areacircle("5")
square(c(3, 4, NA))

Wow!!!



cheungamanda/powers documentation built on May 29, 2019, noon