docs/2020-02-25_r-packages-docs.md

2020-02-18: R packages: Documenting

https://github.com/2DegreesInvesting/ds-incubator/issues/26

Objectives

Why is documenting important?

Code > Insert Roxygen Skeleton

#' Title
#'
#' @param x 
#'
#' @return
#' @export
#'
#' @examples
f <- function(x) {
  x
} 

--

NOTE:

\@cjyetman recommended to always document explicitly the expected type of each argument to a function. \@2diiKlaus endorsed the comment and asks to do it in all packages we build. \@maurolepore would like to develop a template. Follow this discussion.

How useful are examples?

README: usethis::use_readme_rmd()

Gotchas:

(This rigor feels annoying but helps find problems with the package structure.)

Websites



2DegreesInvesting/ds-incubator documentation built on Oct. 13, 2021, 10:09 a.m.