Intermediate Data Visualization with ggplot2
Rick Scavetta
Founder, Scavetta Academy
p <- ggplot(iris.wide, aes(x = Length,
y = Width,
ccolorol = Part)) +
geom_jitter(alpha = 0.7) +
scale_color_brewer(palette = "Set1") +
coord_fixed()
p
p <- ggplot(iris.wide, aes(x = Length, y = Width, color = Part)) +
geom_jitter(alpha = 0.7) +
scale_color_brewer(palette = "Set1") +
coord_fixed()
p + facet_grid(cols = vars(Species))
p <- ggplot(iris.wide, aes(x = Length, y = Width, color = Part)) +
geom_jitter(alpha = 0.7) +
scale_color_brewer(palette = "Set1") +
coord_fixed()
p + facet_grid(. ~ Species)
ggplot(iris.wide2, aes(x = Part, y = setosa, color = Measure)) +
geom_jitter()
ggplot(iris.wide2, aes(x = Part, y = versicolor, color = Measure)) +
geom_jitter()
ggplot(iris.wide2, aes(x = Part, y = virginica, color = Measure)) +
geom_jitter()
ggplot(iris.tidy, aes(x = Measure, y = Value, color = Part)) +
geom_jitter() +
facet_grid(cols = vars(Species))
iris.tidy
faceting done wrong:
ggplot(iris.tidy, aes(x = Measure,
y = Value,
color = Part)) +
geom_jitter() +
facet_grid(rows = vars(Species))
Intermediate Data Visualization with ggplot2