Skip to main content

Table 3 Example of an R function for converting lipid measurements between mmol/L and mg/dL units

From: Methods for enhancing the reproducibility of biomedical research findings using electronic health records

  1. Function arguments (value and units) are validated prior to performing the calculation and an error is raised if incorrect or missing parameters are supplied