Skip to content

Commit

Permalink
docs: small changes + added .dicts_suggest for dictionary_sugar_inc_get
Browse files Browse the repository at this point in the history
  • Loading branch information
advieser committed Oct 2, 2024
1 parent f5d5af3 commit cce80db
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions R/dictionary_sugar.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,18 @@
#' @param ... (`any`)\cr
#' See description.
#' @param .dicts_suggest (named [`list`])
#' Named list of [dictionaries][Dictionary] used to look up suggestions for `.key` in cases of misspelling.
#' Named list of [dictionaries][Dictionary] used to look up suggestions for `.key` if `.key` does not exist in `dict`.
#'
#' @return [R6::R6Class()]
#' @export
#'
#' @examples
#' library(R6)
#' item = R6Class("Item", public = list(x = 0))
#' d = Dictionary$new()
#' d$add("key", item)
#' dictionary_sugar_get(d, "key", x = 2)
#'
#' @export
dictionary_sugar_get = function(dict, .key, ..., .dicts_suggest = NULL) {
assert_class(dict, "Dictionary")
if (missing(.key)) {
Expand Down Expand Up @@ -148,6 +151,8 @@ fields = function(x) {
#' Keys of the objects to construct - possibly with suffixes of the form `_<n>` which will be appended to the ids.
#' @param ... (any)\cr
#' See description of [mlr3misc::dictionary_sugar].
#' @param .dicts_suggest (named [`list`])
#' Named list of [dictionaries][Dictionary] used to look up suggestions for `.key` if `.key` does not exist in `dict`.
#'
#' @return An element from the dictionary.
#'
Expand Down
3 changes: 2 additions & 1 deletion man/dictionary_sugar_get.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/dictionary_sugar_inc_get.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cce80db

Please sign in to comment.