Skip to content
Prev 293518 / 398503 Next

Simple plot loop

This is correct , now working. I did not have the preceeding comma in "Data2[,i] . . ."

Thanks very much! Very much appreciated. Ben Neal


-----Original Message-----
From: Peter Ehlers [mailto:ehlers at ucalgary.ca]
Sent: Thu 5/3/2012 3:04 PM
To: Ben Neal
Cc: Jim Lemon; r-help at r-project.org
Subject: Re: [R] Simple plot loop
 
Ben,

I think that your original for-loop would work if you just
replaced the 'i' in the lines() call with 'Data2[,i]':

    for (i in 2:length(Data2)) {
       lines(MONTH, Data2[, i], type="o", pch=22, lty=2, col="blue")
    }

Peter Ehlers
On 2012-05-03 07:04, Ben Neal wrote: