@@ -31,6 +31,11 @@ Filter = R6Class("Filter",
31
31
feature_types = NULL ,
32
32
packages = NULL ,
33
33
34
+ # ' @field man (`character(1)`)\cr
35
+ # ' String in the format `[pkg]::[topic]` pointing to a manual page for this object.
36
+ # ' Defaults to `NA`, but can be set by child classes.
37
+ man = NULL ,
38
+
34
39
# ' @field scores
35
40
# ' Stores the calculated filter score values as named numeric vector.
36
41
# ' The vector is sorted in decreasing order with possible `NA` values
@@ -58,9 +63,13 @@ Filter = R6Class("Filter",
58
63
# ' Set of required packages.
59
64
# ' Note that these packages will be loaded via [requireNamespace()], and
60
65
# ' are not attached.
66
+ # ' @param man (`character(1)`)\cr
67
+ # ' String in the format `[pkg]::[topic]` pointing to a manual page for
68
+ # ' this object. The referenced help package can be opened via method
69
+ # ' `$help()`.
61
70
initialize = function (id , task_type , task_properties = character (),
62
71
param_set = ParamSet $ new(), feature_types = character (),
63
- packages = character ()) {
72
+ packages = character (), man = NA_character_ ) {
64
73
65
74
self $ id = assert_string(id )
66
75
self $ task_type = assert_subset(task_type , mlr_reflections $ task_types $ type ,
@@ -73,6 +82,7 @@ Filter = R6Class("Filter",
73
82
self $ packages = assert_character(packages , any.missing = FALSE ,
74
83
unique = TRUE )
75
84
self $ scores = set_names(numeric (), character ())
85
+ self $ man = assert_string(man , na.ok = TRUE )
76
86
},
77
87
78
88
# ' @description
@@ -95,6 +105,12 @@ Filter = R6Class("Filter",
95
105
}
96
106
},
97
107
108
+ # ' @description
109
+ # ' Opens the corresponding help page referenced by field `$man`.
110
+ help = function () {
111
+ open_help(self $ man ) # nocov
112
+ },
113
+
98
114
# ' @description
99
115
# ' Calculates the filter score values for the provided [mlr3::Task] and
100
116
# ' stores them in field `scores`. `nfeat` determines the minimum number of
0 commit comments