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

Name your functions here. Will create an R script.

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

Add roxygen2 documentation to your script, then run this function below to create files for your documentation. Will add to DESCRIPTION file, NAMESPACE file, functions.

devtools::document()

Test functions

use_test("testfunctions.R")
devtools::check()


catarfish/testfunctions documentation built on April 14, 2022, 10:36 a.m.