1
I’m starting now on the R and getting beat up a lot with the Date class. I want to change the format "%Y-%m-%d" to "%b-%Y", but it also changes the class of the vector.
x.data1 <- as.Date(c("2016-11-01", "2016-12-01", "2017-01-01",
"2017-02-01", "2017-03-01", "2017-04-01",
"2017-05-01", "2017-06-01", "2017-07-01"),
format = "%Y-%m-%d")
x.data <- format.Date(x.data1, format = "%b/%Y")
I need to place this vector as the x-axis in Plot (ggplot), but the scale_x_continuous() function is not applicable to the Character class.
addendum: I’ve tried the lubridate and I’ve read several other questions here and in other sources... but nothing works :'(