diff --git a/R/Data.R b/R/Data.R index 47281a6..9aff645 100644 --- a/R/Data.R +++ b/R/Data.R @@ -13,9 +13,9 @@ Data <- R6Class("Data", #' @description #' Constructor of class Data. #' - #' @param id (`character()`) \cr + #' @param id (`character(1)`) \cr #' Object ID. - #' @param ind_col \cr + #' @param ind_col (`character(1)`) \cr #' Column name containing individual IDs. #' @param data_frame \cr #' \code{data.frame} containing data. @@ -42,9 +42,9 @@ Data <- R6Class("Data", #' @description #' Retrieve a data subset for a given variable name and values, a data subset. #' - #' @param var_name \cr + #' @param var_name `character(1)` \cr #' Variable name of interest. - #' @param value \cr + #' @param value `vector(n)` \cr #' Values of interest. #' #' @return @@ -53,7 +53,7 @@ Data <- R6Class("Data", #' @export #' getIndSubset = function (var_name, value) { - # FIXME: Also profide a function getVarSubset() later + # TODO: Also provide a function getVarSubset() later subset_data <- self$clone(deep = FALSE) index = which(subset_data$getDataFrame()[[var_name]] %in% value) data_frame = subset_data$getDataFrame()[index, ] @@ -64,9 +64,9 @@ Data <- R6Class("Data", #' For the given variable name, non existing values in the #' current dataset are returned. #' - #' @param var_name \cr + #' @param var_name `character(1)` \cr #' Variable name of interest. - #' @param value + #' @param value `vector(n)` \cr #' Values of interest. #' #' @return @@ -97,7 +97,7 @@ Data <- R6Class("Data", #' @description #' Set a new \code{data.frame} to the current object. #' - #' @param data_frame + #' @param data_frame `data.frame(1)` #' #' @return #' The current object is returned. diff --git a/R/HashTable.R b/R/HashTable.R index a317d1b..2076698 100644 --- a/R/HashTable.R +++ b/R/HashTable.R @@ -10,7 +10,7 @@ HashTable <- R6Class("HashTable", #' @description #' Initialize a default parameters list. #' - #' @param id (`character(1)`)\cr + #' @param id (`character(1)`) \cr #' ID of the hash table. It must be unique. #' #' @export @@ -23,11 +23,11 @@ HashTable <- R6Class("HashTable", }, #' @description #' Function to add a key-value pair to the hash table. - #' @param key (`character(1)`)\cr + #' @param key (`character(1)`) \cr #' The key to be added. - #' @param value (`object(1)`)\cr + #' @param value (`object(1)`) \cr #' Object to be added. - #' @param .class (`character(1)`)\cr + #' @param .class (`character(1)`) \cr #' Class of the object to be added. #' @export #' diff --git a/R/Lrner.R b/R/Lrner.R index 5cc9cae..30ac507 100644 --- a/R/Lrner.R +++ b/R/Lrner.R @@ -14,16 +14,16 @@ Lrner <- R6Class("Lrner", #' #' #' Learner ID. - #' @param id (`character()`) \cr + #' @param id (`character(1)`) \cr #' Package that implements the learn function. If NULL, the #' learn function is called from the current environment. - #' @param package (`character()`) \cr + #' @param package (`character(1)`) \cr #' Learn function name. - #' @param lrn_fct (`character()`) \cr + #' @param lrn_fct (`character(1)`) \cr #' Learn parameters. - #' @param param (`Param()`) \cr + #' @param param (`Param(1)`) \cr #' Layer on which the learner is stored. - #' @param train_layer (`TrainLayer()`) \cr + #' @param train_layer (`TrainLayer(1)`) \cr #' The training layer where to store the learner. initialize = function (id, package = NULL, @@ -66,7 +66,7 @@ Lrner <- R6Class("Lrner", #' @description #' Tains the current learner (from class [Lrner]) on the current training data (from class [TrainData]). #' - #' @param ind_subset \cr + #' @param ind_subset `vector(1)` \cr #' Individual ID subset on which the training will be performed. #' #' @return diff --git a/R/Model.R b/R/Model.R index c147b6c..4a4f593 100644 --- a/R/Model.R +++ b/R/Model.R @@ -16,13 +16,13 @@ Model <- R6Class("Model", #' @description #' Constructor of Model class. #' - #' @param lrner (`Lrner()`) \cr + #' @param lrner (`Lrner(1)`) \cr #' The learner. - #' @param train_data (`TrainData()`) \cr + #' @param train_data (`TrainData(1)`) \cr #' Training data. - #' @param base_model (`object()`) \cr + #' @param base_model (`object(1)`) \cr #' Base model as returned by the original learn function. - #' @param train_layer \cr + #' @param train_layer (`TrainLayer(1)`) \cr #' The current training layer on which the model is stored. #' #' @return @@ -110,9 +110,9 @@ Model <- R6Class("Model", #' Predict target values for the new data #' (from class [NewData]) taken as into. #' - #' @param new_data \cr + #' @param new_data `NewData(1)` \cr #' An object from class [NewData]. - #' @param ind_subset \cr + #' @param ind_subset `vector(1)` \cr #' Subset of individual IDs to be predicted. #' @param ... #' Further parameters. diff --git a/R/NewData.R b/R/NewData.R index 48dc697..a3091eb 100644 --- a/R/NewData.R +++ b/R/NewData.R @@ -12,13 +12,13 @@ NewData <- R6Class("NewData", #' @description #' Initialize a new object from the current class. #' - #' @param id (`character()`) \cr + #' @param id (`character(1)`) \cr #' Object ID. - #' @param ind_col (`character()`)\cr + #' @param ind_col (`character(1)`)\cr #' Column name containing individual IDs. - #' @param data_frame (`data.frame()`)\cr + #' @param data_frame (`data.frame(1)`)\cr #' \code{data.frame} containing data. - #' @param new_layer (`NewLayer()`) \cr + #' @param new_layer (`NewLayer(1)`) \cr #' Layer where to store the current object. initialize = function (id, data_frame, diff --git a/R/NewLayer.R b/R/NewLayer.R index 945f40f..f404693 100644 --- a/R/NewLayer.R +++ b/R/NewLayer.R @@ -15,9 +15,9 @@ NewLayer <- R6Class("NewLayer", #' @description #' constructor #' - #' @param id (`character()`)\cr + #' @param id (`character(1)`)\cr #' See class Param - #' @param new_study (`NewStudy()`)\cr + #' @param new_study (`NewStudy(1)`)\cr #' initialize = function (id, new_study) { super$initialize(id = id) diff --git a/R/NewMetaLayer.R b/R/NewMetaLayer.R index 61df4b8..4cf0ccc 100644 --- a/R/NewMetaLayer.R +++ b/R/NewMetaLayer.R @@ -13,9 +13,9 @@ NewMetaLayer <- R6Class("NewMetaLayer", #' @description #' constructor #' - #' @param id (`character()`)\cr + #' @param id (`character(1)`)\cr #' See class Param - #' @param new_study (`NewStudy()`)\cr + #' @param new_study (`NewStudy(1)`)\cr #' initialize = function (id, new_study) { super$initialize(id = id) @@ -88,13 +88,13 @@ NewMetaLayer <- R6Class("NewMetaLayer", #' Create and set an [NewData] object to the current #' new meta learner. #' - #' @param id `character()` \cr + #' @param id `character(1)` \cr #' ID of the [NewData] object to be instanciated. - #' @param ind_col `character()` \cr + #' @param ind_col `character(1)` \cr #' Name of individual column IDs. - #' @param data_frame `data.frame` \cr + #' @param data_frame `data.frame(1)` \cr #' \code{data.frame} of layer specific predictions. - #' @param meta_layer `NewLayer()` \cr + #' @param meta_layer `NewLayer(1)` \cr #' Layer where to store the [NewData] object. #' #' @export diff --git a/R/NewStudy.R b/R/NewStudy.R index 8f34765..a05e26e 100644 --- a/R/NewStudy.R +++ b/R/NewStudy.R @@ -21,7 +21,7 @@ NewStudy <- R6Class("NewStudy", #' #' @param id (`character(1)`)\cr #' See class Param - #' @param ind_col (`character(0L)`) + #' @param ind_col (`character(1)`) #' Name of column of individuals IDS initialize = function (id, ind_col) { super$initialize(id = id) @@ -96,7 +96,7 @@ NewStudy <- R6Class("NewStudy", getIndIDs = function() { # FIXME: Adjust to the Predict class layers = self$getKeyClass() - # This code accesses each layer (except MetaLayer) level + # This code accesses each layer (except the MetaLayer) level # and get the target variable layers = layers[layers$class %in% "NewLayer", ] ids_data = NULL @@ -140,6 +140,5 @@ NewStudy <- R6Class("NewStudy", ind_col = character(0L), target = character(0L) ), - # TODO: Define a deep_clone function for this class. cloneable = FALSE ) diff --git a/R/PredictData.R b/R/PredictData.R index a79077e..f1d1922 100644 --- a/R/PredictData.R +++ b/R/PredictData.R @@ -12,11 +12,11 @@ PredictData <- R6Class("PredictData", #' @description #' Initialize a new object from the current class. #' - #' @param id (`character()`) \cr + #' @param id (`character(1)`) \cr #' Object ID. - #' @param ind_col (`character()`)\cr + #' @param ind_col (`character(1)`)\cr #' Column name containing individual IDs. - #' @param data_frame (`data.frame()`)\cr + #' @param data_frame (`data.frame(1)`)\cr #' \code{data.frame} containing data. initialize = function (id, ind_col, @@ -63,7 +63,7 @@ PredictData <- R6Class("PredictData", #' @description #' Assigns a predicted layer to the predicted data. #' - #' @param predict_layer `PredictLayer()` \cr + #' @param predict_layer `PredictLayer(1)` \cr #' #' @return #' The current object diff --git a/R/PredictLayer.R b/R/PredictLayer.R index 76cafb8..6d4fe03 100644 --- a/R/PredictLayer.R +++ b/R/PredictLayer.R @@ -15,7 +15,7 @@ PredictLayer <- R6Class("PredictLayer", #' @description #' constructor #' - #' @param id (`character()`) \cr + #' @param id (`character(1)`) \cr #' The layer ID. initialize = function (id) { super$initialize(id = id) @@ -80,7 +80,7 @@ PredictLayer <- R6Class("PredictLayer", #' @description #' Assigns a predicted study to the predicted layer. #' - #' @param predict_study `PredictStudy()` \cr + #' @param predict_study `PredictStudy(1)` \cr #' #' @return #' The current object @@ -104,6 +104,5 @@ PredictLayer <- R6Class("PredictLayer", private = list( predict_study = NULL ), - # TODO: define a deep_clone function for this class. cloneable = FALSE ) diff --git a/R/PredictMetaLayer.R b/R/PredictMetaLayer.R index eb19cb1..a784dfb 100644 --- a/R/PredictMetaLayer.R +++ b/R/PredictMetaLayer.R @@ -13,9 +13,9 @@ PredictMetaLayer <- R6Class("PredictMetaLayer", #' @description #' constructor #' - #' @param id (`character()`)\cr + #' @param id (`character(1)`)\cr #' See class Param - #' @param predict_study (`PredictStudy()`)\cr + #' @param predict_study (`PredictStudy(1)`)\cr #' initialize = function (id, predict_study) { super$initialize(id = id) diff --git a/R/PredictStudy.R b/R/PredictStudy.R index fa834ed..6d93b40 100644 --- a/R/PredictStudy.R +++ b/R/PredictStudy.R @@ -30,7 +30,7 @@ PredictStudy <- R6Class("PredictStudy", #' #' @param id (`character(1)`)\cr #' See class Param - #' @param ind_col (`character(0L)`) + #' @param ind_col (`character(1L)`) #' Name of column of individuals IDS initialize = function (id, ind_col) { super$initialize(id = id) @@ -45,7 +45,7 @@ PredictStudy <- R6Class("PredictStudy", cat(sprintf("PredictStudy : %s\n", private$id)) cat(sprintf("Nb. layers : %s\n", length(private$hash_table))) }, - #' @param meta_layer_id (`character()`) \cr + #' @param meta_layer_id (`character(1)`) \cr #' ID of the meta layer where the new meta data will be stored. #' #' @description @@ -143,6 +143,5 @@ PredictStudy <- R6Class("PredictStudy", private = list( ind_col = NULL ), - # TODO: Define a deep_clone function for this class. cloneable = FALSE ) diff --git a/R/TrainData.R b/R/TrainData.R index 7761650..3b04e1f 100644 --- a/R/TrainData.R +++ b/R/TrainData.R @@ -14,11 +14,11 @@ TrainData <- R6Class("TrainData", #' @description #' Initialize a new object from the current class. #' - #' @param id (`character()`) \cr + #' @param id (`character(1)`) \cr #' The Object ID. - #' @param data_frame (`data.frame()`)\cr + #' @param data_frame (`data.frame(1)`)\cr #' \code{data.frame} containing data. - #' @param train_layer (`TrainLayer()`) \cr + #' @param train_layer (`TrainLayer(1)`) \cr #' Training layer where to store the current object. initialize = function (id, data_frame, @@ -122,7 +122,7 @@ TrainData <- R6Class("TrainData", #' is returned. #' @export #' - #FIXME: Maybe rename getNewLayer, getTrainLayer and getPredictLayer as getLayer? + #TODO: Maybe rename getNewLayer, getTrainLayer and getPredictLayer as getLayer? getNewLayer = function () { return(private$train_layer) } diff --git a/R/TrainLayer.R b/R/TrainLayer.R index dcfe287..8cbf469 100644 --- a/R/TrainLayer.R +++ b/R/TrainLayer.R @@ -23,9 +23,9 @@ TrainLayer <- R6Class("TrainLayer", #' @description #' constructor #' - #' @param id (`character()`)\cr + #' @param id (`character(1)`)\cr #' See class Param - #' @param train_study (`TrainStudy()`)\cr + #' @param train_study (`TrainStudy(1)`)\cr #' initialize = function (id, train_study) { super$initialize(id = id) @@ -71,7 +71,7 @@ TrainLayer <- R6Class("TrainLayer", #' @description #' Trains the current layer. #' - #' @param ind_subset [vector] \cr + #' @param ind_subset `vector(1)` \cr #' ID subset of individuals to be used for training. #' #' @return @@ -106,8 +106,8 @@ TrainLayer <- R6Class("TrainLayer", #' @description #' Predicts values for the new layer taking as argument. #' - #' @param new_layer [TrainLayer()] \cr - #' @param ind_subset [vector()] \cr + #' @param new_layer `TrainLayer()` \cr + #' @param ind_subset `vector()` \cr #' #' @return #' A new [PredictLayer] object with the predicted data is returned. diff --git a/R/TrainMetaLayer.R b/R/TrainMetaLayer.R index 139b45b..282e1b8 100644 --- a/R/TrainMetaLayer.R +++ b/R/TrainMetaLayer.R @@ -21,9 +21,9 @@ TrainMetaLayer <- R6Class("TrainMetaLayer", #' @description #' constructor #' - #' @param id (`character()`)\cr + #' @param id (`character(1)`)\cr #' See class Param - #' @param train_study (`TrainStudy()`)\cr + #' @param train_study (`TrainStudy(1)`)\cr #' initialize = function (id, train_study) { super$initialize(id = id) @@ -65,7 +65,7 @@ TrainMetaLayer <- R6Class("TrainMetaLayer", #' @description #' Trains the current layer. #' - #' @param ind_subset [vector] \cr + #' @param ind_subset `vector(1)` \cr #' ID subset of individuals to be used for training. #' #' @return @@ -100,8 +100,8 @@ TrainMetaLayer <- R6Class("TrainMetaLayer", #' @description #' Predicts values for the new layer taking as argument. #' - #' @param new_layer [TrainLayer()] \cr - #' @param ind_subset [vector()] \cr + #' @param new_layer `TrainLayer(1)` \cr + #' @param ind_subset `vector(1)` \cr #' #' @return #' A new study with the predicted values is returned. @@ -242,15 +242,15 @@ TrainMetaLayer <- R6Class("TrainMetaLayer", #' Create and set an [TrainData] object to the current #' meta learner. #' - #' @param id `character()` \cr + #' @param id `character(1)` \cr #' ID of the [TrainData] object to be instanciated. - #' @param ind_col `character()` \cr + #' @param ind_col `character(1)` \cr #' Name of individual column IDs. - #' @param data_frame `data.frame` \cr + #' @param data_frame `data.frame(1)` \cr #' \code{data.frame} of layer specific predictions. - #' @param meta_layer `Layer()` \cr + #' @param meta_layer `Layer(1)` \cr #' Layer where to store the [TrainData] object. - #' @param target `character` \cr + #' @param target `character(1)` \cr #' Name of the target variable #' #' @export diff --git a/R/TrainStudy.R b/R/TrainStudy.R index 1646b9f..7028bca 100644 --- a/R/TrainStudy.R +++ b/R/TrainStudy.R @@ -28,10 +28,10 @@ TrainStudy <- R6Class("TrainStudy", #' @description #' constructor #' - #' @param id (`character(1L)`)\cr - #' @param ind_col (`character(0L)`) + #' @param id (`character(1)`)\cr + #' @param ind_col (`character(1)`) #' Name of column of individuals IDS - #' @param target (`character(0L)`) + #' @param target (`character(1)`) #' Name of the target variable #' @seealso [NewStudy] and [PredictStudy] initialize = function (id, ind_col, target) { @@ -60,7 +60,7 @@ TrainStudy <- R6Class("TrainStudy", #' @description #' Train each layer of the current Trainstudy. #' - #' @param ind_subset (`character()`)\cr + #' @param ind_subset (`character(1)`)\cr #' Subset of individuals IDs to be used for training. #' #' @return @@ -87,9 +87,9 @@ TrainStudy <- R6Class("TrainStudy", #' @description #' Predicts values given new data. #' - #' @param new_study (`NewData()`) \cr + #' @param new_study (`NewData(1)`) \cr #' Object of class [NewData]. - #' @param ind_subset (`vector()`) \cr + #' @param ind_subset (`vector(1)`) \cr #' Subset of individuals IDs to be used for training. #' #' @return @@ -121,9 +121,9 @@ TrainStudy <- R6Class("TrainStudy", #' Creates a meta training dataset and assigns it to the meta layer. #' #' - #' @param resampling_method (`function()`) \cr + #' @param resampling_method (`function(1)`) \cr #' Function for internal validation. - #' @param resampling_arg (`list()`) \cr + #' @param resampling_arg (`list(1)`) \cr #' List of arguments to be passed to the function. #' #' @return @@ -201,11 +201,11 @@ TrainStudy <- R6Class("TrainStudy", #' @description #' Trains the current study. All leaners and the meta learner are trained. #' - #' @param ind_subset [`vector()`] \cr + #' @param ind_subset [`vector(1)`] \cr #' ID subset to be used for training. - #' @param resampling_method (`function()`) \cr + #' @param resampling_method (`function(1)`) \cr #' Function for internal validation. - #' @param resampling_arg (`list()`) \cr + #' @param resampling_arg (`list(1)`) \cr #' List of arguments to be passed to the function. #' #' @return @@ -231,9 +231,9 @@ TrainStudy <- R6Class("TrainStudy", #' @description #' Predicts a new study. #' - #' @param new_study [TrainStudy] \cr + #' @param new_study `TrainStudy(1)` \cr #' A new study to be predicted. - #' @param ind_subset [vector()] \cr + #' @param ind_subset `vector()` \cr #' Vector of IDs to be predicted. #' #' @return diff --git a/R/predict.weightedMeanLearner.R b/R/predict.weightedMeanLearner.R index dc727f2..283a863 100644 --- a/R/predict.weightedMeanLearner.R +++ b/R/predict.weightedMeanLearner.R @@ -5,7 +5,7 @@ #' #' @include weightedMeanLearner.R #' -#' @param object `weightedMeanLearner()` \cr +#' @param object `weightedMeanLearner(1)` \cr #' An object from class [weightedMeanLearner] #' @param data `data.frame` \cr #' \code{data.frame} to be predicted. diff --git a/R/weightedMeanLearner.R b/R/weightedMeanLearner.R index ce4fea7..a30dd95 100644 --- a/R/weightedMeanLearner.R +++ b/R/weightedMeanLearner.R @@ -3,9 +3,9 @@ #' @description #' Layer weights are estimated for each layer based on Brier score. #' -#' @param x `data.frame()` \cr +#' @param x `data.frame(1)` \cr #' \code{data.frame} of predictors. -#' @param y `vector` \cr +#' @param y `vector(1)` \cr #' Target observations. #' #' @return