Revision a6a4107a08051dfddc3c733102d002fd8617ab9e authored by Lars Kotthoff on 25 October 2014, 00:00:00 UTC, committed by Gabor Csardi on 25 October 2014, 00:00:00 UTC
1 parent c389439
Raw File
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) {
    return(entropy(table(x, useNA="always")))
}
back to top