https://github.com/cran/FSelector
Raw File
Tip revision: 04f271f14fba8652b1ba48e065b58dbbc8b36bbd authored by Piotr Romanski on 11 April 2009, 00:00 UTC
version 0.15
Tip revision: 04f271f
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.logical(d[[i]]))
			d[[i]] = factor(d[[i]])
	}
	return(d)
}
back to top