Skip to content

Instantly share code, notes, and snippets.

@grayskripko
Last active March 17, 2017 10:03
Show Gist options
  • Save grayskripko/2a13b0d2081c9056538ab6ee1a6e520d to your computer and use it in GitHub Desktop.
Save grayskripko/2a13b0d2081c9056538ab6ee1a6e520d to your computer and use it in GitHub Desktop.
> ls()
character(0)
> foo <- function() list(a=1, b=2)
> invisible(list2env(foo(), envir = environment()))
> ls()
[1] "a" "b" "foo"
> rm(list=ls())
> foo <- function() list(1, 2)
> invisible(list2env(mapply(assign, c('c', 'd'), foo(), SIMPLIFY = F), envir=environment()))
> ls()
[1] "c" "d" "foo"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment