alessandro carletti a écrit :
> 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

Package lattice is your friend. Using your example:

Data <- read.table(file = "clipboard", header = TRUE)
library(lattice)
xyplot(temperature ~ depth | NAME, data = Data)

Best,

Renaud

-- 
Dr Renaud Lancelot, vétérinaire
Projet FSP régional épidémiologie vétérinaire
C/0 Ambassade de France - SCAC
BP 834 Antananarivo 101 - Madagascar

e-mail: [EMAIL PROTECTED]
tel.:   +261 32 40 165 53 (cell)
         +261 20 22 665 36 ext. 225 (work)
         +261 20 22 494 37 (home)

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to