Debian Codegraph @

tests/testthat/_snaps/label-date.md

raw
1 # date_short doesn't change unexpectedly
2
3 Code
4 dformat <- label_date_short()
5 # dates
6 jan1 <- as.Date("2010-01-01")
7 dformat(seq(jan1, length = 8, by = "7 day"))
8 Output
9 [1] "01\nJan\n2010" "08" "15" "22"
10 [5] "29" "05\nFeb" "12" "19"
11 Code
12 dformat(seq(jan1, length = 8, by = "3 month"))
13 Output
14 [1] "Jan\n2010" "Apr" "Jul" "Oct" "Jan\n2011" "Apr"
15 [7] "Jul" "Oct"
16 Code
17 dformat(seq(jan1, length = 8, by = "1 year"))
18 Output
19 [1] "2010" "2011" "2012" "2013" "2014" "2015" "2016" "2017"
20 Code
21 # date-times
22 jan1 <- as.POSIXct("2010-01-01", tz = "UTC")
23 dformat(seq(jan1, length = 6, by = "3 hours"))
24 Output
25 [1] "00:00\n01\nJan\n2010" "03:00" "06:00"
26 [4] "09:00" "12:00" "15:00"
27 Code
28 dformat(seq(jan1, length = 6, by = "7 day"))
29 Output
30 [1] "01\nJan\n2010" "08" "15" "22"
31 [5] "29" "05\nFeb"
32 Code
33 dformat(seq(jan1, length = 6, by = "3 month"))
34 Output
35 [1] "Jan\n2010" "Apr" "Jul" "Oct" "Jan\n2011" "Apr"
36 Code
37 dformat(seq(jan1, length = 6, by = "1 year"))
38 Output
39 [1] "2010" "2011" "2012" "2013" "2014" "2015"
40