FlukeAndFeather / jese4sci-DOC

Documentation track of the jese4sci short course
0 stars 0 forks source link

DOC201 #21

Open hffung opened 2 years ago

hffung commented 2 years ago

How to use roxygen

  1. roxygen keyword to include examples: @examples
  2. roxygen keywords to document function • inputs: @param • outputs: @return
  3. RStudio shortcuts for • inserting roxygen skeleton: shift-control-command-R (Mac) / shift-control-alt-R (PC)
    • compiling documentation: Ctrl/Cmd + Shift + D

Critique roxygen comments Function: lmer() • inputs (formula, data, REML, control, start, verbose, subset, weights, na.action, offset, contrasts, devFunOnly) are listed under "Arguments" • types are specified • there aren't any size requirements • I don't think there are ambiguities—the input descriptions are very detailed • examples are provided, but they're not runnable

Write roxygen comments Please see the roxygen comments in my final project with @raecv and @Ronghao94.

mcgoodman commented 2 years ago

Excellent answers Hannah! Totally agree, lme4::lmer has very detailed documentation. You actually can run the example code as long as you've library(lme4) first - the datasets/objects that code references are also loaded when you load lme4!

As for your Roxygen comments, could you please link to your final project repository? Thanks!