[R] [External] Creating model formulas programmatically

Richard M. Heiberger rmh @end|ng |rom temp|e@edu
Sat Mar 29 23:12:51 CET 2025


> somenames <- c("Heigh", "Ho", "Silver", "Away")
> as.formula(paste("~(",paste(somenames, collapse="+"),")^2"))
~(Heigh + Ho + Silver + Away)^2
> 

> On Mar 29, 2025, at 14:30, Bert Gunter <bgunter.4567 using gmail.com> wrote:
> 
> somenames <- c("Heigh", "Ho", "Silver", "Away")



More information about the R-help mailing list