David, Do these work for you? (I am resending this so others can see. The original only went to you.)
library(lubridate) a<-c(4, 5, 6) b<-c("18:00", "18:01", "18:02") c<-as.data.frame(cbind(a,b)) c$d<-hm(c$b) c$d$minute[2] I could do it manually like this (where FrHour is fractional hour) a<-c(4, 5, 6) b<-c("18:00", "18:09", "18:42") c<-as.data.frame(cbind(a,b)) c$d<-hm(c$b) c$d$minute[2] c$Hour=as.numeric(substr(c$b,1,2)) c$Second=as.numeric(substr(c$b,4,5)) c$FrHour <- c$Hour + c$Second/60 As I was writing Rui posted another option with code for graphing. Tim -----Original Message----- From: R-help <r-help-boun...@r-project.org> On Behalf Of Parkhurst, David Sent: Sunday, September 18, 2022 4:27 PM To: r-help@r-project.org Subject: [R] Need help plotting [External Email] I�ve been retired since �06 and have forgotten most of R. Now I have a use for it, with some data from Bloomington�s Environmental Commission. I have a dataframe (obtained from read.csv) that contains numerous columns, including time (in Excel�s 18:00 format), and DNO2, and MNO2 from two air quality instruments. I�d like a plot of both the NO2 measurements against time. I be happy to use either ordinary R plots or ggplot2 ones, if that would be a better way. I�d much appreciate help. [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.