[R] create separate plots by factors

Ingrid Tohver itohver at u.washington.edu
Fri Aug 7 21:05:31 CEST 2009


Hello,
I am attempting to create several plots based on "site" (~300 total)  
and am having trouble with the code. I simply want to create a plot  
using the code, plot(year, peak), for the following dataset. I would  
like for each site to be plotted on a separate page and the plots  
saved in a directory. Would a "foreach" loop work? I tried a "by"  
statement, but it doesn't seem to work with plotting functions.
I would really appreciate any leads.
Ingrid

  site          year   peak
ALBEN       5  101529.6
ALBEN      10  117483.4
ALBEN      20  132960.9
ALBEN      50  153251.2
ALBEN     100  168647.8
ALBEN     200  184153.6
ALBEN     500  204866.5
ALDER       5    6561.3
ALDER      10    7897.1
ALDER      20    9208.1
ALDER      50   10949.3
ALDER     100   12287.6
ALDER     200   13650.2
ALDER     500   15493.6
AMERI       5   43656.5
AMERI      10   51475.3
AMERI      20   58854.4
AMERI      50   68233.3
AMERI     100   75135.9
AMERI     200   81908.3


Ingrid M Tohver
Research Scientist, Climate Impacts Group
University of Washington




More information about the R-help mailing list