You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nathan Green at UCL is developing the rocletCHEERs package which allows users to reference specific CHEERS checklist items in Roxygen code for functions. This would mean for example that a function that relates to discounting of costs and benefits would have: @cheers discounting in the roxygen2 code. The benefit of this is having a summary of which functions relate to each item on the checklist.
We want to utilize this functionality in our table, adding the cheers checklist from these tags as a column. For example:
function_name
package
test_path
cheers_item
x
y
z
w
The problem is that we currently identify functions at the function call, not the function definition. Therefore we would need an algorithm to do one of the following:
for each function, search for the function definition, which will always start with function_name <- function( or function_name = function(. Look at the roxygen code for the function and locate @cheers and then take the remaining words on that line.
just search the code-base for @cheers and each time this string appears identify the function below it. For example in the below we would want to return a list where the element uncertainty contains the function name example_foo.
#' Example Function
#'
#' Description
#'
#' @param param1 Description of Param 1
#' @param param2 Description of Param 2
#' @param param3 Description of Param 3
#'
#' @cheers uncertainty
#'
#' @return what it returns
#'
#' @examples
#' \dontrun{
#' example_foo()
#' }
#'
example_foo <- function(param1, param2, param3) {
<some code>
}
The text was updated successfully, but these errors were encountered:
Nathan Green at UCL is developing the rocletCHEERs package which allows users to reference specific CHEERS checklist items in Roxygen code for functions. This would mean for example that a function that relates to discounting of costs and benefits would have:
@cheers discounting
in the roxygen2 code. The benefit of this is having a summary of which functions relate to each item on the checklist.We want to utilize this functionality in our table, adding the cheers checklist from these tags as a column. For example:
The problem is that we currently identify functions at the function call, not the function definition. Therefore we would need an algorithm to do one of the following:
for each function, search for the function definition, which will always start with
function_name <- function(
orfunction_name = function(
. Look at the roxygen code for the function and locate@cheers
and then take the remaining words on that line.just search the code-base for
@cheers
and each time this string appears identify the function below it. For example in the below we would want to return a list where the elementuncertainty
contains the function nameexample_foo
.The text was updated successfully, but these errors were encountered: