Create R Package

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)}})

Set Directory to Desktop

setwd("~/Desktop")

Create New Package

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.

Analyzing Function Components

formals(cleanse)

body(cleanse)

environment(cleanse)

Set Directory to New Package

setwd("~/Desktop/testPackage")

Add Documentation to New Package

document()

Set Directory for New Package Install

setwd("..")

Install New Package

install("testPackage")

Install Package Library

library(testPackage)

Sabalico Logo
Sabalytics Logo
World Map Logo
rStatistics Logo
Time Zone Logo
Galaxy View Logo
Periodic Table Logo
My Location Logo
Weather Track Logo
Sprite Sheet Logo
Barcode Generator Logo
Test Speed Logo
Website Tools Logo
Image Tools Logo
Color Tools Logo
Text Tools Logo
Finance Tools Logo
File Tools Logo
Data Tools Logo
History of Humanity - History Archive Logo
History of Humanity - History Mysteries Logo
History of Humanity - Ancient Mesopotamia Logo
History of Humanity - Egypt History Logo
History of Humanity - Persian Empire Logo
History of Humanity - Greek History Logo
History of Humanity - Alexander the Great Logo
History of Humanity - Roman History Logo
History of Humanity - Punic Wars Logo
History of Humanity - Golden Age of Piracy Logo
History of Humanity - Revolutionary War Logo