Last active
March 17, 2017 10:03
-
-
Save grayskripko/2a13b0d2081c9056538ab6ee1a6e520d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> 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