[R] Odp: two plots on the same axis

Petr PIKAL petr.pikal at precheza.cz
Wed Oct 7 10:31:46 CEST 2009


Hi

You did not provide enough information of what and how you want to do the 
plot

> summary(temp)
       V1          V2               V3              V4 
 Min.   :5   Min.   : 1.000   Min.   : 1.00   Min.   :3300 
 1st Qu.:5   1st Qu.: 3.000   1st Qu.: 8.00   1st Qu.:3947 
 Median :5   Median : 6.000   Median :15.00   Median :3996 
 Mean   :5   Mean   : 6.513   Mean   :15.52   Mean   :3976 
 3rd Qu.:5   3rd Qu.:10.000   3rd Qu.:23.00   3rd Qu.:4053 
 Max.   :5   Max.   :12.000   Max.   :31.00   Max.   :4137 
> temp2<-read.table("2006.txt")
> summary(temp2)
       V1          V2               V3              V4 
 Min.   :6   Min.   : 1.000   Min.   : 1.00   Min.   :4010 
 1st Qu.:6   1st Qu.: 3.000   1st Qu.: 9.00   1st Qu.:4190 
 Median :6   Median : 5.500   Median :16.00   Median :4225 
 Mean   :6   Mean   : 5.725   Mean   :16.04   Mean   :4213 
 3rd Qu.:6   3rd Qu.: 8.000   3rd Qu.:23.00   3rd Qu.:4248 
 Max.   :6   Max.   :11.000   Max.   :31.00   Max.   :4312

>From summaries of your data you have 2 files with year no in first, month 
in second, day in third and some value in fourth column. The value from 
year 2006 is greater than the value in 2005. 

For accommodating all 4.column data you need to set correct range by ylim.
And if you use lines on non sorted values it can result in clump of lines. 
You could maybe consult ?aggregate and or ?supsmu

However only you know what you want as an x values and as an y values. 

Regards
Petr


r-help-bounces at r-project.org napsal dne 07.10.2009 10:12:24:

> Good morning. I wish to plot two data on the same axis. I tried 
plot(x,y,
> type = "l") for the first and tried to use lines or points(x,y, lty = 2, 
col
> = 4) to add or plot the second data on alongside the first. However, 
what I
> got was not encouraging.
> I have attached the two data and would be pleased if anybody could be of
> help.
> Thank you
> Best regards
> Ogbos
> [příloha 2005.txt odstraněna uživatelem Petr PIKAL/CTCAP] [příloha 
2006.txt 
> odstraněna uživatelem Petr PIKAL/CTCAP] 
______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list