[R] graphing help

Peter Dalgaard p.dalgaard at biostat.ku.dk
Sat Sep 19 15:28:58 CEST 2009


Mag Gam wrote:
> Hello:
> 
> I am very new to "R", and I am trying to plot a large data set. I
> would like to get a line graph. My data looks like this in a csv file
> (no header):
> 
> 07/03/23,05:00,23
> 07/03/23,06:00,32
> 07/03/23,07:00,33
> 07/03/23,08:00,25
> 07/03/23,09:00,26
> 07/03/23,10:00,21
> 07/03/23,11:00,23
> 07/03/23,12:00,24
> 07/03/23,13:00,25
> 07/03/23,14:00,29
> 07/03/23,15:00,23
> 07/03/23,16:00,23
> 
> 
> TIA
> 
> ______________________________________________
> 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.

Let's see...

dd <- read.csv("clipboard", header=F)
dd
names(dd)<- c("D","TOD","Y")
dd$T <- as.POSIXct(paste(dd$D, dd$TOD), format="%y/%m/%d %H:%M")
plot(Y~T,data=dd, type="b")


-- 
    O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
   c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
  (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907




More information about the R-help mailing list