#install.packages("RJDemetra")
#install.packages("ggdemetra")
library(RJDemetra)
library(ggdemetra)
<- window(ipi_c_eu, start = c(2000, 1), end = c(2010, 12))
ipi_c_eu <- ts2df(ipi_c_eu)
ipi_c_eu_df <- ggplot(data = ipi_c_eu_df, mapping = aes(x = date, y = FR)) +
p1 geom_line() + ggtitle("Without geom_outlier")
<- ggplot(data = ipi_c_eu_df, mapping = aes(x = date, y = FR)) +
p2 geom_line() + geom_outlier(geom = "label_repel") + ggtitle("With geom_outlier")
/p2 p1
15 O
15.1 geom_outlier
Package
ggdemetra (Quartier-la-Tente 2024)
Description
Function to add directly to the plot the outliers used in the pre-adjustment process of the seasonal adjustment.
Understandable aesthetics
required aesthetics
date
y
Note: frequency must be equal to 12, 6, 4 or 2
optional aesthetics
first_date
, last_date
, coefficients
, digits
, show.legend
, inherit.aes
See also
geom_text, geom_label geom_text_repel, geom_label_repel
Example
15.2 geom_outline
Package
ggplot2 (Wickham 2016)
Description
Understandable aesthetics
required aesthetics
x
y
optional aesthetics
alpha
, colour
, group
, linetype
, linewidth
See also
Example
15.3 geom_outline_point
Package
ggplot2 (Wickham 2016)
Description
Understandable aesthetics
required aesthetics
x
y
optional aesthetics
alpha
, colour
, group
, linetype
, linewidth
See also
Example
15.4 geom_overhang_seats
Package
ggparliament (ggparliament?)
Description
Draw overhang seats in mixed-member proportional (MMP) electoral systems
Understandable aesthetics
required aesthetics
expr
optional aesthetics
alpha
, colour
, group
, linetype
, linewidth
See also
Example
#devtools::install_github("zmeers/ggparliament")
library(ggparliament)
<- tibble(
sriLanka year = 2024,
seats = c(64, 63, 311, 193),
government = c(0, 0, 1, 1),
colour = c("red", "blue", "green", "orange"),
party = c("SLPFA",
"SJB",
"NPP",
"TNA"))
<- parliament_data(
sl_data election_data = sriLanka,
parl_rows = 11,
party_seats = sriLanka$seats,
type = "horseshoe")
$overhang_seats <- rep(
sl_datac(1, 0, 1, 0, 1, 0, 1, 0),
c(295, 16, 11, 182, 3, 61, 3, 60)
)ggplot(sl_data, aes(x, y, colour = party)) +
geom_parliament_seats() +
geom_overhang_seats(overhang_seats == 0.2) +
theme_ggparliament() +
scale_colour_manual(values = c("red", "blue", "green", "orange"))