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")
#> # Robonomist id: entsoe/dap_FI
#> # Title:         Day ahead price for bidding zone, Finland
#> # Vintage:       2024-11-22 13:00:00
#> # A tibble:      2,368 × 5
#>    Area  Currency `Measure unit` time                value
#>  * <chr> <chr>    <chr>          <dttm>              <dbl>
#>  1 FI    EURO     megawatt hours 2023-11-24 23:00:00  28.0
#>  2 FI    EURO     megawatt hours 2023-11-25 00:00:00  25.9
#>  3 FI    EURO     megawatt hours 2023-11-25 01:00:00  25.5
#>  4 FI    EURO     megawatt hours 2023-11-25 02:00:00  25.2
#>  5 FI    EURO     megawatt hours 2023-11-25 03:00:00  25.5
#>  6 FI    EURO     megawatt hours 2023-11-25 04:00:00  20.9
#>  7 FI    EURO     megawatt hours 2023-11-25 05:00:00  23.3
#>  8 FI    EURO     megawatt hours 2023-11-25 06:00:00  26.1
#>  9 FI    EURO     megawatt hours 2023-11-25 07:00:00  34.3
#> 10 FI    EURO     megawatt hours 2023-11-25 08:00:00  75.0
#> # ℹ 2,358 more rows

data("entsoe/dap_FI") |>
  ggplot(aes(time, value)) +
  geom_line() +
  labs(
    title = "Electricity prices in Finland",
    subtitle = "Day-ahead market price, €/MWh",
    caption = "Source: ENTSO-E Transparency Platform.",
    x = NULL, y = NULL
  )

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 [6s]
#> 
#> 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:

tbl <-
  data("ec/esi_nace2§(Fin|Swe|Ger)§§2020-01-01") |>
  pivot_wider(names_from = Country)
tbl
#> # A tibble: 406 × 5
#>    Indicator                                   time       Germany Finland Sweden
#>    <chr>                                       <date>       <dbl>   <dbl>  <dbl>
#>  1 Industrial confidence indicator (40%)       2020-01-01   -10.7    -8.6   -1.3
#>  2 Services confidence indicator (30 %)        2020-01-01    22      11.3   12.4
#>  3 Consumer confidence indicator (20%)         2020-01-01    -2.9    -4.1   -3.5
#>  4 Retail trade confidence indicator (5%)      2020-01-01    -8.1    -6.1   21.4
#>  5 Construction confidence indicator (5%)      2020-01-01    14.1     0     10.7
#>  6 The Economic sentiment indicator is a comp… 2020-01-01   104.     97.4   98.4
#>  7 The Employment expectations indicator is a… 2020-01-01   105.    106.   102  
#>  8 Industrial confidence indicator (40%)       2020-02-01   -10.5    -4.3    1  
#>  9 Services confidence indicator (30 %)        2020-02-01    22.4     4.9    9.3
#> 10 Consumer confidence indicator (20%)         2020-02-01    -2.3    -4.7   -2.3
#> # ℹ 396 more rows

writexl::write_xlsx(tbl, "export.xlsx")