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-01-16 07:00:00
#> # A tibble: 139 × 6
#> Area Currency `Measure unit` resolution time value
#> * <chr> <chr> <chr> <chr> <dttm> <dbl>
#> 1 FI EURO megawatt hours PT60M 2025-01-10 23:00:00 26.8
#> 2 FI EURO megawatt hours PT60M 2025-01-11 00:00:00 22.0
#> 3 FI EURO megawatt hours PT60M 2025-01-11 01:00:00 17.6
#> 4 FI EURO megawatt hours PT60M 2025-01-11 02:00:00 15.7
#> 5 FI EURO megawatt hours PT60M 2025-01-11 03:00:00 20.2
#> 6 FI EURO megawatt hours PT60M 2025-01-11 04:00:00 25.3
#> 7 FI EURO megawatt hours PT60M 2025-01-11 05:00:00 27.5
#> 8 FI EURO megawatt hours PT60M 2025-01-11 06:00:00 35.4
#> 9 FI EURO megawatt hours PT60M 2025-01-11 07:00:00 38.8
#> 10 FI EURO megawatt hours PT60M 2025-01-11 08:00:00 41.1
#> # ℹ 129 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
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 [5.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:
tbl <-
data("ec/esi_nace2§(Fin|Swe|Ger)§§2020-01-01") |>
pivot_wider(names_from = Country)
tbl
#> # A tibble: 420 × 5
#> Indicator time Germany Finland Sweden
#> <chr> <date> <dbl> <dbl> <dbl>
#> 1 Industrial confidence indicator (40%) 2020-01-01 -10.6 -8.6 -1.4
#> 2 Services confidence indicator (30 %) 2020-01-01 22 11.3 12.3
#> 3 Consumer confidence indicator (20%) 2020-01-01 -2.7 -4.1 -3.4
#> 4 Retail trade confidence indicator (5%) 2020-01-01 -8.1 -6.2 21.4
#> 5 Construction confidence indicator (5%) 2020-01-01 14 0.1 10.8
#> 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.4 -4.4 0.9
#> 9 Services confidence indicator (30 %) 2020-02-01 22.4 4.9 9.2
#> 10 Consumer confidence indicator (20%) 2020-02-01 -2 -4.7 -2.2
#> # ℹ 410 more rows
writexl::write_xlsx(tbl, "export.xlsx")