Custom R Packages

Create R Package

install roxygen2 and devtools and probably rstudioapi

create directory folder w/ name of package (ex. bunsbriefcase)

within that folder, create 2 folders: R and man

create inst folder in package folder, in that create rstudio folder, in that create addins.dcf file (create any file type in Rstudio and save as ???addins.dcf???)

In R folder, create R script with functions & roxygenise()

In R folder, create R script -package.R and roxygenise() it

	#'<packagename>
#'
#'@description <one or more full sentences!!>
#'
#'@keywords internal
#'
#'@import <packages your package depends on>
"_PACKAGE"

Note: @description must be one or more full sentences!

In main directory folder create DESCRIPTION file

Package: <packagename>
Type: Package
Title: Imports favorite functions and packages
Version: 0.1.0
Author: Firstname Lastname
Maintainer: Firstname Lastname <valid email>
Description: Package Description.
License: GPL (>= 2)
Encoding: UTF-8
LazyData: true
Imports: rstudioapi
RoxygenNote: 7.2.1

build -> configure build tools

Make sure directory is correct for package folder created in step 2
Check generate documentation with roxygen2

Build -> check package

Build -> install package

check addins

should be there. If so can bind to keyboard shortcuts

Previous