[R] simplify source code

Christof Kluß ckluss at email.uni-kiel.de
Sat Nov 26 23:30:29 CET 2011


Hi

I would like to shorten

mod1 <- nls(ColName2 ~ ColName1, data = table, ...)
mod2 <- nls(ColName3 ~ ColName1, data = table, ...)
mod3 <- nls(ColName4 ~ ColName1, data = table, ...)
...

is there something like

cols = c(ColName2,ColName3,ColName4,...)

for i in ...
   mod[i-1] <- nls(ColName[i] ~ ColName1, data = table, ...)

I am looking forward to help

Christof



More information about the R-help mailing list