https://github.com/cran/FSelector
Tip revision: 1acf016f2b5cbaf99f6418c3eb7d5734215ebcf1 authored by Lars Kotthoff on 22 August 2023, 17:10:02 UTC
version 0.34
version 0.34
Tip revision: 1acf016
misc.R
as.simple.formula <- function(attributes, class) {
return(as.formula(paste(class, paste(attributes, sep = "", collapse = " + "), sep = " ~ ")))
}
get.data.frame.from.formula <- function(formula, data) {
d = model.frame(formula, data, na.action = NULL)
for(i in 1:dim(d)[2]) {
if(is.factor(d[[i]]) || is.logical(d[[i]]) || is.character(d[[i]]))
d[[i]] = factor(d[[i]])
}
return(d)
}
entropyHelper <- function(x, unit = "log") {
return(entropy(table(x, useNA="always"), unit = unit))
}