convert date into year

Good morning everyone,
I have data base composed of daily trading volumes of bitcoin from 05/2018 to 05/2020 .I got the following plot btc plot 2.
In the plot time starts from may2018 and ends in mars2019.
How can i convert time scale by "year" in order to get 2018 2019 2020 ?

Are you looking for something like this?

library(lubridate)
DF <- data.frame(Time = seq.Date(from = as.Date("2018-05-01"), 
                                 to = as.Date("2019-03-31"), by = 1),
                 Volume = rnorm(n = 335, 1000000, 200000))
Months = as.Date("2018-05-01") %m+% months(0:10)
Labels <- format(Months, "%Y-%b")
plot(DF$Time, DF$Volume, xaxt = "n")
axis(1, at = Months, labels = Labels)

Created on 2020-06-06 by the reprex package (v0.3.0)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.