Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jingmiao7 committed Sep 19, 2024
1 parent 020e943 commit b1c6748
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions week_03/case_study_03.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
install.packages("gapminder")
install.packages("gapminder") # install dataset "gapminder"

library(ggplot2)
library(gapminder)
library(dplyr)
library(ggplot2) # load ggplot
library(gapminder) # load gapminder dataset
library(dplyr) #load the dplyr to use summarize

gapminder
str(gapminder)
str(gapminder) # check the structure of the gapminder

# remove the "Kuwait" from the dataset
NoK_gapminder <- gapminder %>%
filter(country != "Kuwait")

# plot a scatter point of life expetation and gdp with theme_bw, and other co
ggplot(NoK_gapminder, aes(x = lifeExp, y = gdpPercap, color = continent, size = pop/100000)) +
geom_point() +
theme_bw() +
Expand Down

0 comments on commit b1c6748

Please sign in to comment.