Merck / metalite

An R package to create metadata structure for ADaM data analysis and reporting
https://merck.github.io/metalite/
GNU General Public License v3.0
15 stars 6 forks source link

Example did not run properly #149

Closed elong0527 closed 1 year ago

elong0527 commented 1 year ago

https://merck.github.io/metalite/reference/meta_run.html

nanxstats commented 1 year ago

I'm not a non-standard evaluation expert, but I suspect that this is because the eval() in meta_run() is searching in the wrong scope hence cannot find the function defined in the global environment.

Here is a minimal reproducible example to help you experiment with potential solutions. The example code runs ok in regular interactive sessions but under pkgdown it would throw "could not find function 'f'":

#' Title
#'
#' @export
#'
#' @examples
#' f <- function (x) x + 1
#' meta_run()
meta_run <- function() eval(parse(text = "f(1)"))
wangben718 commented 1 year ago

Thanks @nanxstats . Should we resolve this issue after we release our new version?

elong0527 commented 1 year ago

Sounds good!

nanxstats commented 1 year ago

Thanks @nanxstats . Should we resolve this issue after we release our new version?

Agreed, this shouldn't be a blocker for releases. We should prioritize the release.

nanxstats commented 1 year ago

@elong0527 will create a minimal reproducible example package to investigate why this runs ok in vignettes but not function reference pages, possibly an item for upstream feedback.