Skip to contents

Basic PTT line plot

Usage

aplot_lines(
  dat,
  x = time,
  y = value,
  colour = tiedot,
  size = NULL,
  title = "",
  subtitle = "",
  source = NULL,
  caption = "",
  rangeslider = FALSE,
  start_time = NULL,
  ...
)

aplot_trends(
  dat,
  x = time,
  y = value,
  colour = tiedot,
  size = NULL,
  title = "",
  subtitle = "",
  source = NULL,
  caption = "",
  rangeslider = FALSE,
  start_time = NULL,
  org_showlegend = FALSE,
  ...
)

Arguments

dat

A data.frame to plot.

colour

A variable for colours

size

A variable for size.

title

A plot title

subtitle

A plot subtitle, use also for y-axis label.

source

A source information for caption. Text is added to "Lähde: ..., PTT".

caption

A caption text. Will override source

rangeslider

A locigal for rangeslider

...

Additional arguments for ptt_plot.

org_showlegend

A locigal to show legend for original data.

Functions

  • aplot_trends: Estimate and plot trend with original

Examples

ptt_data_robo_l("StatFin/kan/vtp/statfin_vtp_pxt_11sf.px") |>
dplyr::filter(
    taloustoimi %in% c("P7R Tavaroiden ja palvelujen tuonti, tulona",
    "P6K Tavaroiden ja palvelujen vienti, menona"),
    tiedot == c("Volyymin muutokset, %")) |>
    aplot_lines(colour = taloustoimi,
                title = "Vienti ja tuonti",
                subtititle = "%, volyymin muutos",
                source = "Tilastokeskus")
#> i Connecting to robonomistServer at ptt.robonomist.com
#> v Connecting to robonomistServer at ptt.robonomist.com [107ms]
#> 
#> i Connected successfully to robonomistServer 2.5.6
#> v Connected successfully to robonomistServer 2.5.6 [45ms]
#> 
#> \ Requesting get
#> v Requesting get [126ms]
#> 
ptt_data_robo_l("StatFin/kan/ntp/statfin_ntp_pxt_132h.px") |> dplyr::filter( taloustoimi %in% c("P7R Tavaroiden ja palvelujen tuonti, tulona", "P6K Tavaroiden ja palvelujen vienti, menona"), tiedot == c("Alkuperäinen sarja, viitevuosi 2015, miljoonaa euroa")) |> aplot_trends(colour = taloustoimi, title = "Vienti ja tuonti", subtititle = "%, volyymin muutos", source = "Tilastokeskus") #> \ Requesting get #> v Requesting get [123ms] #> #> Warning: X-13 failed #> Warning: X-13 failed #> [1] "P7R Tavaroiden ja palvelujen tuonti, tulona" #> [2] "P6K Tavaroiden ja palvelujen vienti, menona"