Setting up a Package

2026-02-05

Outline

  • file structures of packages

  • documentation

  • development cycle




Resource: R packages by Hadley Wickham

RStudio and R packages

RStudio supports creating new packages. Follow the dialogs through New Project ...

RStudio and R packages (cont’d)

RStudio supports creating new packages. Follow the dialogs through New Project ...

RStudio and R packages (cont’d)

RStudio supports creating new packages. Follow the dialogs through New Project ...

Your Turn

  • Create a new R package using the RStudio dialog to set it up in a new project.

  • Build the package (CMD + shift + B) and run the function hello()

  • Have a look at the help for hello with ?hello

  • Have a look at the file hello.Rd in man/

Your Turn (Advanced)

  • Does the package pass R CMD check? (Cmd + Shift + E)