Using gghalves

Using gghalves

This is my learning note for Using gghalves, ‘gghalves’ is a R package which provides some geoms that are half of ggplot2’s geoms.

R
1
2
3
4
# install.packages("gghalves")
library(gghalves)
# install.packages('tvthemes')
library(tvthemes)

GeomHalfPoint

R
1
2
3
4
5
6
7
8
ggplot(iris) + 
geom_half_point(
aes(x = Species,
y = Sepal.Width)
) +
theme_theLastAirbender(
text.font = "BradleyHandITCTT-Bold"
)

R
1
2
3
4
5
6
7
8
9
ggplot(iris) + 
geom_half_point(
aes(x = Species,
y = Sepal.Width),
transformation_params = list(height = 0, width = 0.001, seed = 1)
) +
theme_theLastAirbender(
text.font = "BradleyHandITCTT-Bold"
)

R
1
2
3
4
5
6
7
8
9
ggplot(iris) + 
geom_half_point(
aes(x = Species,
y = Sepal.Width),
transformation = PositionIdentity
) +
theme_theLastAirbender(
text.font = "BradleyHandITCTT-Bold"
)

GeomHalfBoxplot

R
1
2
3
4
5
6
7
8
ggplot(iris) + 
geom_half_boxplot(
aes(x = Species,
y = Sepal.Width)
) +
theme_spongeBob(
text.font = "BradleyHandITCTT-Bold"
)

R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
ggplot(iris) + 
geom_half_boxplot(
aes(x = Species,
y = Sepal.Width),
side = 'r', center = TRUE,
errorbar.draw = FALSE
) +
geom_half_boxplot(
aes(x = Species,
y = Sepal.Width),
side = 'l', center = TRUE,
errorbar.draw = FALSE
) +
theme_spongeBob(
text.font = "BradleyHandITCTT-Bold"
)

GeomHalfViolin

R
1
2
3
4
5
ggplot(iris) + 
geom_half_violin(aes(x = Species, y = Sepal.Width)) +
theme_rickAndMorty(
text.font = "CascadiaCode-Regular"
)

GeomHalfDotplot

R
1
2
3
4
5
6
7
8
ggplot(iris, aes(x = Species, y = Sepal.Width)) + 
geom_half_violin(aes(fill = Species, color = Species)) +
geom_dotplot(binaxis = "y", method = "histodot",
stackdir = "up", aes(color = Species,
fill = Species)) +
scale_color_simpsons() +
scale_fill_simpsons() +
theme_simpsons(text.font = "Chalkduster")

Working with ggplot2 Extensions

R
1
2
3
4
5
6
7
ggplot(iris, aes(x = Species, y = Sepal.Width,
color = Species, fill = Species)) +
geom_half_boxplot() +
ggbeeswarm::geom_beeswarm(beeswarmArgs = list(side = 1)) +
theme_parksAndRecLight(text.font = "MarkerFelt-Thin") +
scale_color_parksAndRec() +
scale_color_parksAndRec()

# R

Comments

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×