Note: This package is just for learning purpose.
want box cox, log, square, cube? Easy, just load the powers
package!
library(powers)
num<-c(1:10) square(num) cube(num) Box_Cox(num,3,4) log(num,3)
The square()
and cube()
functions are apply
-family friendly, too!
my_list<-list(1:10,0.5,-0.7) ## so base-R-boring! lapply(my_list,function(x) x^2) lapply(my_list,function(x) x^3) ## Use powers instead! lapply(my_list,square) lapply(my_list,cube)
They even come with the ability to omit NA!
num<-c(1:10,NA) square(num,na.omit = TRUE) cube(num,na.omit = TRUE) Box_Cox(num,3,4,na.omit = TRUE) log(num,3,na.omit = TRUE)
wow!!!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.