Re: [R] target of assignment expands to non-language object

2009-03-31 Thread Stavros Macrakis
On Tue, Mar 31, 2009 at 10:05 AM, Alina Sheyman wrote: > 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)) > a) What is the purpose of numbers? Why not write paste("model",i) b) Why a

[R] target of assignment expands to non-language object

2009-03-31 Thread Alina Sheyman
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 tr