listToDf | R Documentation |
Converts a list to a data.frame based on given parameter set.
List elements must have the correct type with respect to parameter set. Exceptions are discrete parameters, whose values should be factors, only characters are accepted and factors are returned.
Returned data.frame
has column names equal to parameter ids. In case
of vector parameters column names will be numbered.
listToDf(list.object, par.set)
list.object |
|
par.set |
|
[data.frame]
library(mlrCPO) # Create parameter set temp <- c("a", "b", "c") ps.simple <- pSS( num: numeric [0, 10], int: integer[0, 10] [[trafo = function(x) x / 10]], char: discrete [temp], selector.selection: logical^10) # Sample values as list and convert list to data frame init.list <- sampleValues(ps.simple, 5, discrete.names = TRUE) result <- listToDf(init.list, ps.simple) result
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.