Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Allow way to get environment for user functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Nov 2, 2023
1 parent 8d532ec commit fe0bf2b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions R/rudf.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,18 +151,18 @@ rxRmFunParse <- function(name) {
}
#' Setup the UDF environment (for querying user defined funtions)
#'
#' @param env environment where user defined functions are queried
#' @return nothing called for side effects
#' @param env environment where user defined functions are queried. If NULL return current environment
#' @return environment
#' @export
#' @author Matthew L. Fidler
#' @keywords internal
.udfEnvSet <- function(env) {
if (.udfEnv$lockedEnvir) return(invisible())
if (.udfEnv$lockedEnvir) return(invisible(.udfEnv$envir))
if (is.environment(env)) {
.udfEnv$envir <- env
return(invisible())
return(invisible(.udfEnv$envir))
}
stop("'env' needs to be an environment")
return(invisible(.udfEnv$envir))
}
#' Lock/Unlock environment for getting R user functions
#'
Expand Down

0 comments on commit fe0bf2b

Please sign in to comment.