I'm just another R rookie who is struggling with datetime objects in R. Can you tell me what is wrong in my code when it gives me a picture like this? I want the x-axis to be hours only, without the date. And sure the hour column of the data frame shouldn't look like this → 2021-07-09 07:30:00. It should be 07:30, 16:30, 18:10 and so on. The date of observations is in another column. Below is the code I used, and it worked just fine with another data frame, so I'm puzzled.
df$hour <- as.POSIXct(df$hour, format="%H:%M")
and ggplot(data=df, aes(x=df$hour)) + geom_freqpoly()