[R] column-plot of rainfall data

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Tue Apr 23 22:28:05 CEST 2002


wouter.buytaert at yucom.be writes:

> Hello,
> 
> I have some daily rainfall data from rain gages. E.g.:
> date       p1   p2   p3
> 20/04/2002 10.2 8.6  6.3
> 21/04/2002 0.4  1.6  1.4
> 22/04/2002 0.2  0.0  0.4
> 23/04/2002 5.2  1.0  0.2
> 
> I'd like to plot them in a column plot by day, to be able to
> compare them. I made an example in exell, that I attached, but
> can't find out how to do it in R. The data vector is a POSIXct.

Something like this:

rain <- read.table("rain.txt",header=T)
barplot(t(as.matrix(rain[-1])),
        names.arg=as.character(rain$date),beside=T)


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list