Open mb706 opened 2 years ago
Usage would then look like
ppl()$help("robustify")
(because ppl()
with empty arguments returns the dictionary)
For this, $add()
would probably need a package
argument that defaults to the name of the "topenv" of the calling frame or something like that.
To construct a minimal object to call $help()
on, some of the items need some extra construction item that is not otherwise supplied, e.g. PipeOpLearner$new()
needs a Learner
-like object. This would be the opportunity to also support that: add an auxiliary construction arguments option to Dictionary$add()
(as I am doing here, see example usage here, note the alist
!) and then use that to construct an object for $help()
access (as here).
Maybe this line, without the $help()
, could then also be a helper function, get_dummy()
, that could then be used by as.data.table()
.
For many objects there is
lrn("xxx")$help()
, but the dictionary can also contain entries that do not map 1-to-1 with R6-classes, such asppl()
, which constructs differentGraph
s. However, we have the nomenclature of<dictname>_<key>
for help files. I therefore suggest thatDictionary$help(<key>)
tries to show help for the<dictname>_<key>
help entry (and, failing that, tries to construct<key>
and call itshelp()
function.