Skip to content

Instantly share code, notes, and snippets.

@quasiben
Created September 20, 2018 01:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quasiben/386deeb2c7e5a1d830220618effdb904 to your computer and use it in GitHub Desktop.
Save quasiben/386deeb2c7e5a1d830220618effdb904 to your computer and use it in GitHub Desktop.
library(reticulate)
use_condaenv("reticulate-r-base")
source_python("daskr.py")
submit <- function(f, args) {
f_str <- serialize(f, NULL)
py_lambda(f_str, args)
}
inc <- function(x){
result <- x + 1
return(result)
}
future <- submit(inc, 1)
print(future)
print(future$done())
print(future$results())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment