R/CreateFormula.R

Defines functions CreateFormula

Documented in CreateFormula

CreateFormula <-
function(data, i, covariable=NULL) {
	if(length(covariable)==0) { fmla <- as.formula(data[,1] ~ data[,i]); return(fmla)
	} else {
		covname <- colnames(covariable)
		fmla <- as.formula(paste("data[,1] ~ data[,i] + ", paste(covname, collapse= "+")))
	}	
	return(fmla)
}

Try the globalGSA package in your browser

Any scripts or data that you put into this service are public.

globalGSA documentation built on May 1, 2019, 9:19 p.m.