Building, Testing and Installing R Packages

Architect ships with a suite of tools to support R package development. If you’re new to developing R packages, Hilary Parker posted a very useful blog on how to write an R package from scratch.

This section assumes you have the structure of an R package more or less in place already. In the top toolbar, clicking the triangle of the External Tools button () opens a list of default tools for R packages (as well as some tools for generating various document types). To customize these, see the section External Tool Configuration.

Once the package is in place, select a tool to check, build or install it.

Package Projects

When creating a new project, you have the option to create an ‘R Package Project’ instead of ‘R Project’. This is largely the same as creating an ‘R Project’, but it allows you to use R code snippets that refer directly to your package.

There is a default snippet for adding roxygen documentation to an R package. For instructions on defining additional snippets or assigning them to hotkeys, see the Defining R Snippets section.

Generate Roxygen Documentation

Packaged functions require proper documentation. This can be done automatically in Architect. Under the Source menu, select Generate Element Comment (Roxygen), and structured documentation will be generated for a selected function. The parameters are pulled automatically from your function code.

One can further customize the default code that is generated by Quick Searching the Code Generation preferences menu. Additionally, you can assign the roxygen documentation to a hotkey.