Am trying to show a line graph for a day records that starts at 6am till 6pm. Now when i try to populate the plot using ggplot and adding annotate to display some text below the graph or with in graph am getting error as
Error: Invalid input: time_trans works with objects of class POSIXct only
here is my sample code which is used to plot
library(ggplot2) #load ggplot
R$date_time<-strptime(x = as.character(R$stc),format = "%d/%m/%Y %H:%M")
R$Req_Date<-as.Date(R$date_time)
R_Day<-R[R$Req_Date=='0015-11-01',]
timerange=as.POSIXct(R_Day$date_time, format="%H:%M:%S")
counTime<-as.data.frame(table(timerange))
calcitime<-sum(counTime$Freq)/60
p<-ggplot(data=R_Day,aes(x=timerange,y=Rinse_Temperature))+
ggtitle("R_Temperature")+geom_line(colour="orange",size=0.5)+
p+annotate("text", x=as.numeric(as.POSIXct(R_Day$date_time, format="%H:%M:%S")),xend=as.numeric(as.POSIXct(R_Day$date_time, format="%H:%M:%S")), y=-300,yend=300, label= "Total")
any suggestion how to override this error and show text.
Thanks in advance