Skip to content
Introduction to the Tidyverse
Introduction to the Tidyverse
(also this is me practicing in workspace)
Run the hidden code cell below to import the data used in this course.
# Load the Tidyverse
library(tidyverse)
# Read in the gapminder file
gapminder <- read.csv("datasets/gapminder.csv", sep = "\t")Visualizing with ggplot2
Don't forget to load the libraries AND the gapminder package....
library(ggplot2)
library(dplyr)
library(tidyverse)
install.packages("gapminder")
library(gapminder)Isolate the year 1952 and store in a separate object
gapminder_1952 <- gapminder %>% filter(year == 1952)
Take a look and see what you got...
gapminder_1952▲ NOICE!!
Let's show off our ability to code a pretty scatter plot that shows gdpPercap(logarithmically scaled) on the x-axis, lifeExp on the y-axis , nicely color coded continents with dots fluxuating in size relative to population...check this out...
ggplot(gapminder_1952, aes(x = gdpPercap, y = lifeExp, color = continent, size = pop)) +
geom_point() +
scale_x_log10()what, wut!!?? or shoud we say, "woot! woot!
Take Notes
Add notes about the concepts you've learned and code cells with code you want to keep.
Add your notes here