mlr-org / mlr3misc

Miscellaneous helper functions for mlr3
https://mlr3misc.mlr-org.com
GNU Lesser General Public License v3.0
11 stars 2 forks source link

lrn(), msr(), po(), ... could print all available keys when called without an argument. #29

Closed mb706 closed 4 years ago

mb706 commented 4 years ago

Unfortunately we can't do tab completion, but this is the closest thing

jakob-r commented 4 years ago

I would say they should throw an error and list all available options. This way we can rely that these functions always return an object of the same class but it will be still helpful for the user. If you want to program on it, you just use the dictonary. Otherwise I could already imagine people writing code like that

lapply(lrn(), lrn)
mb706 commented 4 years ago

Doesnt need to be a string return (although I also don't see a problem with that), it could just cat() the info and return NULL; or it could return the dictionary object in question (whose printer lists all keys).

I wouldn't mind the different return type; the sugar functions can be a bit fuzzy IMHO.