knitr::opts_chunk$set(echo = TRUE)
library(devtools) library(usethis) library(available)
Figure out where you want your package to be saved on your local computer
setwd('..') getwd() create_package("testfunctions")
Connect go git
usethis::use_git()
Connect to github
usethis::use_github()
Add license
usethis::use_apache_license()
Need to build readme when you update readme.
usethis::use_readme_rmd() devtools::build_readme()
use_data_raw()
usethis::use_data()
usethis::use_r("wqplots.r") usethis::use_r("celstofahr.r") usethis::use_r("makeplot.r")
use_package("dplyr") use_package("ggplot2")
use_package_doc()
What packages are needed?
use_import_from("ggplot2", "ggplot") use_import_from("magrittr", "%>%") # will be in namespace and document for pipe # Put in import of DESCRIPTION file # package documentation usethis::use_package_doc() # use_import_from(package, function) # devtools::document() to put it in NAMESPACE
devtools::document()
Test functions
use_test("testfunctions.R")
devtools::check()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.