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")
)
#> Warning: Invalid modebar button(s) given. Valid buttons are: home, closest, compare,
#> zoomin, zoomout, pan, img_w, img_n, img_s, data_dl, robonomist
Electricity prices in Finland
data("entsoe/dap_FI")
#> # Robonomist id: entsoe/dap_FI
#> # Title: Day ahead price for bidding zone, Finland
#> # Vintage: 2025-06-10 12:00:00
#> # A tibble: 161 × 6
#> Area Currency `Measure unit` resolution time value
#> * <chr> <chr> <chr> <chr> <dttm> <dbl>
#> 1 FI EURO megawatt hours PT60M 2025-06-04 22:00:00 -2.14
#> 2 FI EURO megawatt hours PT60M 2025-06-04 23:00:00 -2.13
#> 3 FI EURO megawatt hours PT60M 2025-06-05 00:00:00 -2.41
#> 4 FI EURO megawatt hours PT60M 2025-06-05 01:00:00 -2.31
#> 5 FI EURO megawatt hours PT60M 2025-06-05 02:00:00 -2.46
#> 6 FI EURO megawatt hours PT60M 2025-06-05 03:00:00 -1
#> 7 FI EURO megawatt hours PT60M 2025-06-05 04:00:00 -0.02
#> 8 FI EURO megawatt hours PT60M 2025-06-05 05:00:00 0.59
#> 9 FI EURO megawatt hours PT60M 2025-06-05 06:00:00 1.33
#> 10 FI EURO megawatt hours PT60M 2025-06-05 07:00:00 0.75
#> # ℹ 151 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
)
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
#> ✔ 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: 455 × 5
#> Indicator time Germany Finland Sweden
#> <chr> <date> <dbl> <dbl> <dbl>
#> 1 Industrial confidence indicator (40%) 2020-01-01 -10.5 -9.6 -1.3
#> 2 Services confidence indicator (30 %) 2020-01-01 19.8 10.1 12.5
#> 3 Consumer confidence indicator (20%) 2020-01-01 -2.9 -4.1 -3.5
#> 4 Retail trade confidence indicator (5%) 2020-01-01 -7.8 -6.2 21.3
#> 5 Construction confidence indicator (5%) 2020-01-01 14 -0.4 10.7
#> 6 The Economic sentiment indicator is a comp… 2020-01-01 104. 96.7 98.6
#> 7 The Employment expectations indicator is a… 2020-01-01 105. 105 102.
#> 8 Industrial confidence indicator (40%) 2020-02-01 -10.4 -4.9 0.9
#> 9 Services confidence indicator (30 %) 2020-02-01 20.2 7 9.6
#> 10 Consumer confidence indicator (20%) 2020-02-01 -2.3 -4.7 -2.3
#> # ℹ 445 more rows
writexl::write_xlsx(tbl, "export.xlsx")