Writing packages in R
What???
What is a package?
install.packages()
devtools::install_github()
devtools::install()
Why???
To help people write better code
To share your methods
To share your code
To keep your code organised
To keep your code consistent
How???
What you’re going to do
Practical 3-1
Create a package
Get familiar with its structure
Functions
Write a function (in the R folder)
Write documentation for it
Demos
Write a demo script (in the demo folder)
Edit the demo contents file (00Index)
Test the demo (using
demo()
)
Description
Edit the DESCRIPTION file
Update the package version number
Collaborate
Push to GitHub
Test the packages of the other members of your group