Hi.. I have time data like this "2019-01-01 00:00:00". I want to plot data with this code :
p <- ggplot(data, aes(x=time, y=co)) + geom_line() + xlab("") + scale_x_date(limit=c(as.Date("2019-01-01"),as.Date("2019-12-31")))
but I have an error message like this :
Error: Invalid input: date_trans works with objects of class Date only
And if I change type of data from POSIXct to Date then hours in data is lost. Help me to solve the problem. Thank you..