# Function to generate a key matching Module objects with Task objects and their respective parameters
#
# More detailed explaination here
#
# @param pipeline An object of class \code{Pipeline}
#
# @return A named list of lists where the name of each parent corresponds to a module in \code{pipeline} and each child corresponds to a task within that module
#
# @examples
# \dontrun{
# generateParameterKey(pipeline)
# }
# @keywords internal
generateParameterKey <- function(pipeline){
# count the tasks
task.count <- countTasks(pipeline)
# set up the parameter key
parameter.key <- list()
for(label in names(task.count)){
parameter.key[[label]] <- as.list(rep(NA,task.count[label]))
}
# loop through each module & task, adding all task parameters to the key
for(module in pipeline$modules){
counter <- 0
for(task in module$tasks){
o <- expand.grid(task$control,stringsAsFactors=F)
if(nrow(o)==0){
counter <- counter + 1
task.parameters <- as.list(formals(task$method))
parameter.key[[module$label]][[counter]] <- task.parameters
} else {
for(i in 1:nrow(o)){
counter <- counter + 1
task.parameters <- as.list(formals(task$method))
task.parameters[names(o)] <- o[i,]
parameter.key[[module$label]][[counter]] <- task.parameters
}
}
}
}
# return the parameter key
return(parameter.key)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.