Skip to contents

Setup

library(robonomistClient)
library(tidyverse)
library(roboplotr)
set_roboplot_options(
  xaxis_ceiling = "years",
  modebar = c("home", "closest", "compare", "zoom", "img_n", "img_w", "data_dl")
)

Electricity prices in Finland

data("entsoe/dap_fi") |> roboplot()

FAO food price index

data("tidy/fao_food_price_index§§Food")  |>
  roboplot(Type)

Economic sentiment indicator

data("ec/esi_nace§(Fin|Euro area)§sentiment§2000-01-01")  |>
  roboplot(Country, caption = "European Commission")
data("ec/esi_nace2§(Fin|Swe|Ger)§sentiment§2015-01-01") |>
  ggplot(aes(time, value, color = Country)) +
  geom_line() +
  labs(
    title = "Economic Sentiment Indicator",
    subtitle = "Composite index (average = 100)",
    caption = "Source: European Commission.",
    x=NULL, y=NULL
  )

Inflation

data("eurostat/prc_hicp_manr") |>
  filter(
    coicop %in% c("All-items HICP"),
    geo %in% c("Germany", "Finland", "Sweden"),
    time >= "2015-01-01"
  ) |>
  roboplot(geo, title = "Consumer price inflation", subtitle = "Annual change, %")
#> ⠙ Requesting data
#> ⠹ Requesting data
#>  Requesting data [4.5s]
#> 
#> Using the attribute "source" for plot caption.
#> roboplotr arranged data 'd' column `geo` using mean of 'value'. Relevel `geo`
#> as factor with levels of your liking to control trace order.

The history of births and deaths in Finland

data("StatFin/synt/statfin_synt_pxt_12dx.px", tidy_time = TRUE) |>
  filter(Tiedot %in% c("Elävänä syntyneet", "Kuolleet")) |>
  ggplot(aes(time, value/1000, color = Tiedot)) +
  geom_line() +
  labs(
    title = "Elävänä syntyneet ja kuolleet Suomessa",
    subtitle = "Tuhatta henkeä",
    caption = "Lähde: Tilastokeskus.",
    x=NULL, y=NULL
  )

Exporting data to Excel

You can also export the data, for example to an Excel file:

data("ec/esi_nace2§(Fin|Swe|Ger)§§2015-01-01") %>%
  pivot_wider(names_from = Country) %>%
  split(.$Indicator) %>%
  setNames(names(.) |> str_sub(1, 31)) |>
  writexl::write_xlsx("../man/figures/export.xlsx")