To go back to my progress report...
link to the README.md of hw09

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)

powers

This is an R package that provides power functions. The goal of powers is to make it easier to calculate power functions.

Installation

You can install powers from github with:

# install.packages("devtools")
devtools::install_github("bcahn7/STAT547M-hw09-powers")

Example

This is a basic example which shows you how to solve a common problem:

## basic example code
powers::cube(3)
powers::reciprocal(1:5)

It has additional function to print out a scatter plot! The default value for the argument plot_it is FALSE.

## printing out a scatter plot!
powers::square(1:5, plot_it = TRUE)
powers::reciprocal(1:10, plot_it = TRUE)

In addition, it has an argument for na.omit. This is an option to remove NAs from an input vector. The default value is FALSE.

powers::cube(c(1,2,3, NA, 5, 6, NA, 8), plot_it = FALSE, na.omit = TRUE)
powers::four(c(1,2,3, NA, NA ,NA), na.omit = TRUE)

This powers package also has a boxcoxt function which print out the one-parameter Box-Cox transformation.
This function does not calculate the optimal lambda value. Using boxcox() in the MASS package is recommended for the optimal lambda. The default value of lambda is 0.1

powers::boxcoxt(5:10)
powers::boxcoxt(1:10, lambda = 0.3)

When the input lambda is too big(>5) or too small(<-5), there's a warning: "The input lambda value is too big or too small".

powers::boxcoxt(1:10, lambda = 9)

For convenience, there are two datasets in powers package. Those datasets are 1:10, -(1:10)

powers::tenvec
powers::negtenvec

For Developers

Use the internal pow function as the machinery for the front-end functions such as square, cube, four, and reciprocal.



bcahn7/STAT547M-hw09-powers documentation built on May 30, 2019, 4:15 p.m.