Skip to content
Prev 265311 / 398502 Next

What's wrong with my code? (Edited version-added my data)

Take a closer look at your R code. Each loop is returning only the
last value, so you're doing the same thing over and over for the last
value from the previous loop.

Write just the code for *one* set of graphs. Look at what needs to
change to do the next set. Write a function that takes those arguments
and makes the graphs. Don't try to cram everything into a whole bunch
of for() loops.

As you've found, that can be very error-prone.

Sarah
On Tue, Jul 12, 2011 at 9:12 PM, Susie <susiecrab_ling at hotmail.com> wrote: