I am sorry if this is a basic question, but I am wondering if callr is able to support custom user functions that are defined in the global environment? I understand that the use of "::" is essential for functions from other packages, but custom user functions exist outside of any package. Here is an example of what I would like to be able to do:
x <- 3
userFunction <- function(x){
y <- (2 * x + 7)
return(y)
}
z <- r_bg(function(a) userFunction(a), args = list(x))
This currently returns the error:
Error: <callr_status_error: callr subprocess failed: could not find function "userFunction">
-->
<callr_remote_error in userFunction(a):
could not find function "userFunction">
in process 20466
See `.Last.error.trace` for a stack trace.
Where the code below works just fine
x <- 3
z <- r_bg(function(a) sum(a), args = list(x))
Thank you!
The text was updated successfully, but these errors were encountered:
Hi,
I am sorry if this is a basic question, but I am wondering if callr is able to support custom user functions that are defined in the global environment? I understand that the use of "::" is essential for functions from other packages, but custom user functions exist outside of any package. Here is an example of what I would like to be able to do:
This currently returns the error:
Where the code below works just fine
Thank you!
The text was updated successfully, but these errors were encountered: