Diagram batang

Pengantar Tidyverse

David Robinson

Chief Data Scientist, DataCamp

Rangkuman per benua

by_continent <- gapminder %>%
  filter(year == 2007) %>%
  group_by(continent) %>%
  summarize(meanLifeExp = mean(lifeExp))

by_continent
# A tibble: 5 x 2
  continent meanLifeExp
      <fct>       <dbl>
1    Africa    54.80604
2  Americas    73.60812
3      Asia    70.72848
4    Europe    77.64860
5   Oceania    80.71950
Pengantar Tidyverse

Diagram batang

plot batang rata-rata harapan hidup per benua

ggplot(by_continent, aes(x = continent, y = meanLifeExp)) +
  geom_col()
Pengantar Tidyverse

Ayo berlatih!

Pengantar Tidyverse

Preparing Video For Download...