Skip to the content.

๐Ÿ“ฆ Workshop 2: Package Your Code

R Package

โ€œTurn your R scripts into shareable, installable, and testable tools.โ€
โ€” Level UP your Code! โ€“ Workshop 2


๐ŸŽฏ Workshop Goal

Learn how to transform your R code into a proper R package so that it can be reused, installed, tested, and shared easily.


๐Ÿง  Key Concepts


โš™๏ธ Tools Youโ€™ll Use


๐Ÿงฐ Starter Resources


๐Ÿ› ๏ธ Quick Workflow

# Set up your package structure
usethis::create_package("mypackage")

# Add and document a function
usethis::use_r("myfunction")
usethis::use_roxygen_md()
devtools::document()

# Add tests
usethis::use_testthat()
usethis::use_test("myfunction")

# Install locally
devtools::install()

โญ๏ธ Next Workshop : GitHub โ€“ Save & Deploy Your Code