Skip to content

Instantly share code, notes, and snippets.

@smbache
Created June 8, 2015 21:02
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 smbache/1704489003d010fcf610 to your computer and use it in GitHub Desktop.
Save smbache/1704489003d010fcf610 to your computer and use it in GitHub Desktop.
# Contents of test.R:
#
# library(ggplot2)
#
# my_plot <- qplot(Sepal.Length, Sepal.Width, data = iris)
# my_plot2 <- qplot(Petal.Length, Petal.Width, data = iris)
#
```R
> import::from(test.R, my_plot)
> import::from(test.R, my_plot2) # separate call; importing again will not re-source!
> search()
[1] ".GlobalEnv" "imports" "tools:rstudio"
[4] "package:stats" "package:graphics" "package:grDevices"
[7] "package:utils" "package:datasets" "package:methods"
[10] "Autoloads" "package:base"
> loadedNamespaces()
[1] "MASS" "colorspace" "scales" "import" "magrittr"
[6] "plyr" "graphics" "tools" "gtable" "reshape2"
[11] "utils" "grDevices" "Rcpp" "stats" "ggplot2"
[16] "datasets" "stringi" "grid" "methods" "stringr"
[21] "digest" "proto" "munsell" "base"
>
```R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment