install.packages(“gapminder”) library(tidyverse) library(gapminder) data(gapminder) gapminder #population VS time of germany gapminder_ger<-filter(gapminder, country == ‘Germany’) ggplot(gapminder_ger) + geom_point(mapping = aes(x = pop, y = year)) ggplot(gapminder_ger) + geom_line(mapping = aes(x = pop, y = year)) #Create same plots for your own country. gapminder_Ind<-filter(gapminder, country == ‘India’) ggplot(gapminder_Ind) + geom_point(mapping = aes(x = pop, y = year)) ggplot(gapminder_Ind) + geom_line(mapping = aes(x = pop, y = year)) #Make a histogram of for life expectancy values for year 2007. Do not forget that you need to subset your dataset gapminder_2007 <- gapminder %>% filter(year == 2007) p = ggplot(gapminder_2007, aes(x=lifeExp, fill=year)) + geom_histogram(position=“identity”, colour=“grey40”, alpha=0.2, bins = 10) p #Create a facets of histograms life expectancy values by year p = ggplot(gapminder, aes(x=lifeExp, fill=country)) + geom_histogram(position=“identity”, colour=“grey40”, alpha=0.2, bins = 10)+ facet_grid(. ~year ) p #Create a line plot of life expectancy values for the countries. In the aesthetics, you need to set x,y and by ggplot(gapminder) + geom_line(aes(x = lifeExp, y = country)) + scale_x_log10() #Create a line plot of life expectancy values for the countries. Set the color for the continent values In the aesthetics, you need to set x,y, by and color. ggplot(data = gapminder) + geom_line(mapping = aes(x =lifeExp , y = country, color = continent, size = pop)) + scale_x_log10() #Create a line plot of life expectancy values for the countries. create the facets for the continent values ggplot(gapminder_2007) + geom_line(aes(x = lifeExp, y = country, color = year, size = pop)) + scale_x_log10() + facet_wrap(~ continent)