Open jackwasey opened 7 years ago
+1 to be able to use this without the package being loaded. e.g.
wakefield::r_data_theme(n = 100)
doesn't work without the package being loaded.
Would be great if this could work.
@jackwasey This is a very generalizable problem. Nowadays many people prefer not to risk polluting their global search path.
r_data_frame
function, injecting bindings from the package's namespace such as id
and age
in a parent environment. r_data_frame
function itself so that it always evaluate the symbols in the package's own namespace.@iqis any interest in a pull request?
@trinker
I'm actually not able to reproduce the issue with wakefield::r_data_frame(id, age, n = 500)
(which works perfectly) in R 3.6.0 and wakefield 0.3.3... Perhaps this has to do with R enforcing the use of namespaces in packages at some point between this question and now.
A packages function always look for bindings in the package's namespace first, it seems.
Thanks for making this useful package.
I tried to use it initially by doing:
This fails because, it seems, the
id
andage
, etc, functions need to be available. It is beyond my knowledge, but perhaps you could interpret the symbols given in the wakefield namespace. Adding all those generic-sounding names to my namespace is a little worrying. I suppose I can call each function directly, usingwakefield::
but this becomes more cumbersome. Just a thought.