# Creating a Personal R Package
# A package to make package development easier
library(devtools)
# Creates the barebones of my package, including:
# A directory that houses my packages files
# Some files that I will edit later ("DESCRIPTION", "NAMEPACE", etc.)
# A directory called R, that will house my functions!
devtools::create("C:/Users/millionc/OneDrive - YCCD/R/researchR")
# Make sure this script does not get built with the package
# i.e., put it into .Rbuildignore
devtools::use_build_ignore("researchR_build_script.R")
devtools::use_build_ignore("README.md")
# Include package dependencies. Which packages does my package depend on?
devtools::use_package("dplyr")
# Document my functions bu putting #' and @params
devtools::document()
# In your functions documentation, make sure you include the following command somewhere in the #` block
#`
#`@export
#`
# Including Data
#Load a dataset into the working library then use
devtools::use_data()
#Document a Dataset by creating a .R file with the same name as the dataset.
# Where you are ready to install your package, use the following function
devtools::install()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.