-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
as(..., "factor") is not defined, but not caught in the loop.
also, this function can be used to automatically convert logicals, which are else somehow saved as strings.
my temporary fix in the rds branch:
type_fix = function(x, par.set) {
# type conversion to make sure (Workaround for https://github.com/berndbischl/ParamHelpers/issues/203)
par_types = getParamTypes(par.set, with.nr = TRUE, use.names = TRUE, df.cols = TRUE)
df_types = vcapply(x, class)
type_misses = df_types == "logical" & par_types[names(df_types)] != df_types
if (any(type_misses)) {
for (col in names(type_misses[type_misses])) {
if(par_types[col] != "factor") {
x[[col]] = as(x[[col]], par_types[col])
}
}
}
for (col in names(par_types)) {
if (par_types[col] == "logical") {
x[[col]] = as.logical(x[[col]])
}
}
return(x)
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels