Build your own R package with your functions using this code. Packages are great ways to easily store and deploy scripts and code.
packages <- c("devtools", "roxygen2")
packages <- lapply(packages, FUN = function(x) {
if(!require(x, character.only = TRUE)) {install.packages(x)
library(x, character.only = TRUE)}})
setwd("~/Desktop")
create("testPackage")
Create a new file for each function or list functions sequentially in one file.
* Make sure to add documentation comments before each function.
formals(cleanse)
body(cleanse)
environment(cleanse)
setwd("~/Desktop/testPackage")
document()
install("testPackage")
library(testPackage)