[R] Problems producing a simple plot
Peter Flom
peterflomconsulting at mindspring.com
Sat May 2 18:00:14 CEST 2009
Steve Murray <smurray444 at hotmail.com> wrote
>
>I have a data frame of the nature:
>I am hoping to plot columns 2 and 3 against Latitude. I understand that you have to do this by plotting one column at a time, so I have been starting by attempting the following, but receiving errors:
>
>
>I'm obviously doing something fundamentally wrong (!). I'd be grateful for any suggestions as to how I should go about this.
>
I think what you are doing wrong is misinterpreting what people mean when they say "line". They don't mean line of data, they mean line on the plot.
Does this get you started?
lat <- seq(-55:-50)
simrun <- c(574.09, 247.23, 103.41, 86.99, 45.22, 55.93)
obsrun <- c(491.95, 319.66, 237.82, 179.54, 105.30, 136.61)
plot(simrun~lat,type = 'l')
lines(obsrun~lat)
Peter
Peter L. Flom, PhD
Statistical Consultant
www DOT peterflomconsulting DOT com
More information about the R-help
mailing list