Skip to content

Instantly share code, notes, and snippets.

View StatsRhian's full-sized avatar

Rhian Davies StatsRhian

View GitHub Profile
@StatsRhian
StatsRhian / ggplot-recap.R
Created June 12, 2020 13:28
ggplot recap
library(ggplot2)
data(movies, package = "jrIntroduction")
# 1. Create a histogram of movie ratings
# 2. Play around with different binwidths
# 3. Change the histogram to a density plot
# 4. Add a title
library("gapminder")
library("ggplot2")
library("plotly")
data(gapminder, package = "gapminder")
g = ggplot(gapminder, aes(x = gdpPercap, y = lifeExp,
size = pop, colour = continent,
frame = year, label = country)) +
geom_point(alpha = 0.5)