Skip to content

Style Guide for Roxygen Headers

Ben Straub edited this page Feb 5, 2024 · 6 revisions

Core xport_ functions: type, length, label, write, format and order

These functions should follow the same style for all parts of the roxygen header.

Title

  • Short and direct on purpose of function.
  • Use active verbs

Sub-Title

Each of these functions assumes the availability of a well-defined specification objects.

  • Assumptions:
    • An appropriate metadata object with a {fill-in} column available
    • Any distinct column needs

@param Arguments for xportr_ functions

As the xportr_ functions follow a common design the @params should all appear in the same order.

  • .df - A dataframe with columns that can be {fill-in}
  • metadata - An appropriate metadata object that has available {fill-in} avaiable
  • domain - Appropriate CDSIC dataset name, e.g. ADAE, DM. Used to subset the metadata object. If none is passed, then name of the dataset passed .df will be used.
  • verbose - sets the type of message to the user
  • additional arguments - arguments needed for additional processing should always be placed after the 4 standard arguments for xportr functions.

@examples for xportr_ functions

  • Showcase a simple working example
  • Showcase a simple working with a verbose = warn
  • Showcase a simple example with verbose = stop