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")
)
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 [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")