March 2019
Beginner to intermediate
448 pages
13h 14m
English
In this exercise, we have sales and profits for several companies across multiple years. We want to create a scatterplot (which shows pairs of values between sales and profit) animated through time.
install.packages('devtools')devtools::install_github('thomasp85/gganimate')
# Load required packagelibrary(gapminder)library(ggplot2)library(gganimate)# Basic scatter plot
data = read.csv("./companies.csv",stringsAsFactors = FALSE)colors = c("A"="#AB5406","B"="#EC9936","C"="#BE1826","D"="#9B4A06","E"="#FDD6A2","F"="#9ACD62")
Read now
Unlock full access