Skip to content

Commit c647d69

Browse files
committed
fix docs
1 parent ffe723f commit c647d69

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

R/bayesplot-helpers.R

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,12 +474,17 @@ overlay_function <- function(...) {
474474

475475
# Resolve a function name and store the expression passed in by the user
476476
#' @noRd
477-
#' @param f a function-like object
478-
#' @param f_expr (optional) expression to provide. We need this value when
479-
#' constructing tagged function inside of a function function.
477+
#' @param f a function-like thing: a string naming a function, a function
478+
#' object, a `quote()`-ed function name, an anonymous function object, and
479+
#' `NULL`.
480+
#' @param f_expr (optional) expression to record. Inside of a function we would
481+
#' write `as_tagged_function(stat, enexpr(stat))` to make sure that the user's
482+
#' expression is the tagged expression.
480483
#' @param fallback character string providing a fallback function name
481484
#' @return the function named in `f` with an added `"tagged_expr"` attribute
482-
#' containing the expression to represent the function name.
485+
#' containing the expression to represent the function name and an
486+
#' `"is_anonymous_function"` attribute to flag if the expression is a call to
487+
#' `function()`.
483488
as_tagged_function <- function(f, f_expr = NULL, fallback = "func") {
484489
if (is.null(f_expr)) f_expr <- enexpr(f)
485490
if (!is.null(attr(f, "tagged_expr"))) return(f)

0 commit comments

Comments
 (0)