Converts the given cohort JSON to Capr R code and inserts it into the active RStudio editor. The function looks upward from the current cursor position for the previous call to insertCaprCode() in the file and inserts the generated code on the line directly below that call. For interactive use in RStudio only; requires the rstudioapi package.

insertCaprCode(jsonPath, mode = c("strict", "skip"))

Arguments

jsonPath

Character. Path to the cohort JSON file.

mode

"strict" or "skip" (see jsonToCapr).

Value

Invisibly, the inserted Capr code (character string).