
Get range
get_range.RdGet range
Examples
full_range <- c("2000-01-01", "2025-10-01")
get_range("Past year", full_range)
#> $plot_start
#> [1] "2025-01-01"
#>
#> $plot_end
#> [1] "2026-01-01"
#>
#> $x_label
#> [1] "2025 - 2026"
#>
get_range("Calendar year", full_range)
#> $plot_start
#> [1] "2025-01-01"
#>
#> $plot_end
#> [1] "2025-12-31"
#>
#> $x_label
#> [1] "2025"
#>
get_range(c("2024-10-01", "2025-06-01"), full_range)
#> $plot_start
#> [1] "2024-10-01"
#>
#> $plot_end
#> [1] "2025-06-01"
#>
#> $x_label
#> [1] "2024 - 2025"
#>
get_range(c(NA, "2020-01-01"), full_range)
#> $plot_start
#> [1] "2000-01-01"
#>
#> $plot_end
#> [1] "2020-01-01"
#>
#> $x_label
#> [1] "2000 - 2020"
#>
get_range(c("2020-01-01", NA), full_range)
#> $plot_start
#> [1] "2020-01-01"
#>
#> $plot_end
#> [1] "2025-10-01"
#>
#> $x_label
#> [1] "2020 - 2025"
#>