Skip to content
Prev 75008 / 398502 Next

using "for" loop

Hi everybody,
how can I create a loop for plotting parameters for
each level of a variable, for example:

NAME   temperature  depth
aaa      23           -1
aaa      22           -2
aaa      24           -1
bbb      23           -4
bbb      23           -1 
aaa      22           -1
bbb      22            0

I mean, I would like R to plot temperature vs depth
for aaa, then another plot for bbb, and so on.

Is it for loop ok?
Thanks