I'm running the following code numbers <- 1:50 for (i in 1:50) assign(paste("model",numbers[i]),i)<-(lm(temp$Overall.Scaled.Score~temp$raw.score))
where I want R to create 50 different models-1:50, but get the following error message "target of assignment expands to non-language object". I've tried it with paste("model",numbers[i]))<-(lm(temp$Overall.Scaled.Score~temp$raw.score) and get the same error. Does anyone know what the problem is or whether there's a better way to get at what I'm trying to do? [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.