| 
30 | 30 | #' The parameters are the parameters inherited from [`PipeOpTaskPreproc`], as well as:  | 
31 | 31 | #' * `renaming` :: named `character` | `function`\cr  | 
32 | 32 | #'   Takes the form of either a named `character` or a `function`.  | 
33 |  | -#'   Named `character` vector. The names of the vector specify the old column names that should be  | 
34 |  | -#'   changed to the new column names as given by the elements of the vector. Initialized to the empty  | 
35 |  | -#'   character vector.  | 
36 |  | -#'   `function`. Specifies how the column names should be changed to new column names. To choose columns use the  | 
37 |  | -#'   `affect_columns` parameter. No function is initialized.  | 
 | 33 | +#'   For a named `character` vector the names of the vector elements specify the  | 
 | 34 | +#'   old column names and the corresponding element values give the new column names.  | 
 | 35 | +#'   Initialized to an empty character vector.  | 
 | 36 | +#'   A `function` specifies how the old column names should be changed to the new column names.  | 
 | 37 | +#'   To choose columns use the `affect_columns` parameter. No function is initialized.  | 
38 | 38 | #' * `ignore_missing` :: `logical(1)`\cr  | 
39 | 39 | #'   Ignore if columns named in `renaming` are not found in the input [`Task`][mlr3::Task]. If this is  | 
40 | 40 | #'   `FALSE`, then names found in `renaming` not found in the [`Task`][mlr3::Task] cause an error.  | 
 | 
60 | 60 | #' pop = po("renamecolumns", param_vals = list(renaming = c("Petal.Length" = "PL")))  | 
61 | 61 | #' pop$train(list(task))  | 
62 | 62 | #'  | 
63 |  | -#' pop = po("renamecolumns",  | 
 | 63 | +#' pof = po("renamecolumns",  | 
64 | 64 | #'          param_vals = list(renaming = function(colnames) {sub("Petal", "P", colnames)}))  | 
65 |  | -#' pop$train(list(task))  | 
 | 65 | +#' pof$train(list(task))  | 
66 | 66 | #'  | 
67 | 67 | 
 
  | 
68 | 68 | PipeOpRenameColumns = R6Class("PipeOpRenameColumns",  | 
 | 
0 commit comments