Writing the documentation for a package

As mentioned, the man folder contains all the necessary documentation files. It consists of R documentation files, which can be recognized by their file extension Rd.

Documenting our R code as well as possible is very important. It gives other people the chance to understand our functions and how to actually implement them into their workflow.

After creating the project, this folder contains a basic documentation file for the project in general. The R documentation files are written in the so-called Rd-format, which is closely related to LaTeX and can be processed into various output formats including HTML or plain text.

Creating Rd documentation files

We have two ways to create an Rd file:

  • We can call the

Get Mastering RStudio – Develop, Communicate, and Collaborate with R now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.