Introductie tot datavisualisatie met ggplot2
Rick Scavetta
Founder, Scavetta Academy
ggplot(iris, aes(x = Sepal.Length,
y = Sepal.Width)) +
geom_point()

ggplot(iris, aes(x = Sepal.Length,
y = Sepal.Width,
color = Species)) +
geom_point()
| Type | Variabele |
|---|---|
| Kleur | Species |

ggplot(iris, aes(x = Sepal.Length,
y = Sepal.Width,
color = Species)) +
geom_point()
| Type | Variabele |
|---|---|
| Kleur | Species |
Species, een kolom in de dataframe, wordt gemapt op kleur, een zichtbare esthetiek.

ggplot(iris, aes(x = Sepal.Length,
y = Sepal.Width,
color = Species)) +
geom_point()
| Type | Variabele |
|---|---|
| Kleur | Species |
Species, een kolom in de dataframe, wordt gemapt op kleur, een zichtbare esthetiek.
Map esthetieken in aes().

ggplot(iris) +
geom_point(aes(x = Sepal.Length,
y = Sepal.Width,
col = Species))
Alleen nodig als:

| Esthetiek | Omschrijving |
|---|---|
| x | Positie X-as |
| y | Positie Y-as |
| Esthetiek | Omschrijving |
|---|---|
| x | Positie X-as |
| y | Positie Y-as |
| fill | Vulkleur |
| Esthetiek | Omschrijving |
|---|---|
| x | Positie X-as |
| y | Positie Y-as |
| fill | Vulkleur |
| color | Kleur van punten, omlijnen van andere geoms |
| Esthetiek | Omschrijving |
|---|---|
| x | Positie X-as |
| y | Positie Y-as |
| fill | Vulkleur |
| color | Kleur van punten, omlijnen van andere geoms |
| size | Oppervlak of straal van punten, lijndikte |
| Esthetiek | Omschrijving |
|---|---|
| x | Positie X-as |
| y | Positie Y-as |
| fill | Vulkleur |
| color | Kleur van punten, omlijnen van andere geoms |
| size | Oppervlak of straal van punten, lijndikte |
| Esthetiek | Omschrijving |
|---|---|
| alpha | Transparantie |
| Esthetiek | Omschrijving |
|---|---|
| x | Positie X-as |
| y | Positie Y-as |
| fill | Vulkleur |
| color | Kleur van punten, omlijnen van andere geoms |
| size | Oppervlak of straal van punten, lijndikte |
| Esthetiek | Omschrijving |
|---|---|
| alpha | Transparantie |
| linetype | Streepjespatroon van lijn |
| Esthetiek | Omschrijving |
|---|---|
| x | Positie X-as |
| y | Positie Y-as |
| fill | Vulkleur |
| color | Kleur van punten, omlijnen van andere geoms |
| size | Oppervlak of straal van punten, lijndikte |
| Esthetiek | Omschrijving |
|---|---|
| alpha | Transparantie |
| linetype | Streepjespatroon van lijn |
| labels | Tekst in plot of op assen |
| Esthetiek | Omschrijving |
|---|---|
| x | Positie X-as |
| y | Positie Y-as |
| fill | Vulkleur |
| color | Kleur van punten, omlijnen van andere geoms |
| size | Oppervlak of straal van punten, lijndikte |
| Esthetiek | Omschrijving |
|---|---|
| alpha | Transparantie |
| linetype | streepjespatroon van lijn |
| labels | Tekst in plot of op assen |
| shape | Vorm |
Introductie tot datavisualisatie met ggplot2