EdBo wrote: > > You are right Joshua. > > I changed the code because I failed to understand how you attached the > full data set. How you made the data part of your code. > > I am new to R so I am used to one way of attaching data(the way I redone > it). >
You don't need to "attach" the data by using attach(). You read the data into an object afull and then select the part you need and store that in object a. BTW: shouldn't the for (i in 1:4) be for (i in 1:3) if I understand the original question correctly? Berend -- View this message in context: http://r.789695.n4.nabble.com/loop-in-optim-tp3643230p3648171.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.