Skip to contents

Parameters to add and customize the locale as used by roboplotr.

Usage

set_locale(locale = "fi-FI")

Arguments

locale

Character. Currently supports on only "en-GB", "en-US", "sv-SE", or "fi-FI" (the default).

Value

A list of class roboplot.set_locale

Examples

# You might want to display dates or numbers with some another default format
# for decimal marks or thousand marks.

set_roboplot_options(
  locale = set_locale("en-GB"),
  caption_template = "Source: {text}."
  )

d <- energiantuonti |>
  dplyr::filter(Alue == "USA", Suunta == "Tuonti") |>
  dplyr::mutate(value = value * 1000000, Alue = "Canada")

d |>
  roboplot(color = Alue,
           title = "Energy import",
           subtitle = "Mil. \u20AC",
           caption = "Statistics Finland")
# This works on dates, too, if you need to show an exact date. In this # example you wouldn't, and it only matters on the hoverlabel here, but let's # force roboplotr() to display dates at by-day accuracy for the sake of example # by using data frequency of "Daily". attr(d, "frequency") <- "Daily" d |> roboplot(color = Alue, title = "Energy import", subtitle = "Mil. \u20AC", caption = "Statistics Finland")
# Revert to defaults: set_roboplot_options(reset = TRUE)