Skip to content
Prev 163507 / 398506 Next

Variables inside a for

?as.formula

copied from the help file:

## Create a formula for a model with a large number of variables:
xnam <- paste("x", 1:25, sep="")
(fmla <- as.formula(paste("y ~ ", paste(xnam, collapse= "+"))))
--  
David Winsemius
On Dec 1, 2008, at 7:45 PM, Raphael Saldanha wrote: