r-rudra / tidycells

Automatic transformation of untidy spreadsheet-like data into tidy form
https://r-rudra.github.io/tidycells/
Other
83 stars 10 forks source link

use <attach> to dynamically export optional components in the search space #34

Open bedantaguru opened 4 years ago

bedantaguru commented 4 years ago

Following is the prototype


nev <- new.env()

get_new_var <- function(){

  attach(nev, pos = 2L, name = "pkg:internals")
}

nev$`%+%` <- function(x, y){
  x*y
}

Note that the above needs to be tuned for the fact that it does not detach on the unload of the package.

bedantaguru commented 3 years ago

Check this https://github.com/r-rudra/patch/issues/3

Done in dynamic_attachment.R and in zzz.R