I want to creat a time vector which starts at 0:05:00 A.M and ends at 0:00:00 A.M the next day.The interval between each time spot is 5 minutes;
Then I want a y-t line plot with qplot().
Here is my R code:
qplot(t,y,geom = 'line')
Here is a solution using
POSIX formatting for dates which is easy to manipulate with ggplot:
df = data.frame( t = seq(as.POSIXct("2016-01-01 05:00:00"), as.POSIXct("2016-01-02 00:00:00"), by = '5 min', tz = "Europe"), y = rnorm(229,5,1)) ggplot(df, aes(t, y)) + geom_line() + scale_x_datetime(labels = date_format('%H:%M', tz = "GMT"), breaks = date_breaks('2 hours'))