R/helper.R

Defines functions helper

Documented in helper

#' Helper
#' @param expr An expression
#' @return The expression evaluated.
#' @export
#'
#' @examples
#' x6 <- 1:6
#' helper(x6 + 1)
#'

# nocov start
helper <- function(expr) {
  sexpr <- substitute(expr)
  if (is.call(sexpr)) {
    cat("ok\n")
  }
  lhs <- sexpr[[2L]]
  cat(as.character(lhs), "\n")
  eval.parent(lhs)
}
# nocov end

Try the hutilscpp package in your browser

Any scripts or data that you put into this service are public.

hutilscpp documentation built on Oct. 11, 2023, 9:06 a.m.