library(ggplot2)
library(dplyr)
## 
## Присоединяю пакет: 'dplyr'
## Следующие объекты скрыты от 'package:stats':
## 
##     filter, lag
## Следующие объекты скрыты от 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tidyr)
library(treemapify)
gapminder <- read.csv("https://raw.githubusercontent.com/plotly/datasets/master/gapminderDataFiveYear.csv")
gapminder1 <- as.data.frame(gapminder %>% dplyr::filter(year == 1952) %>% group_by(continent) %>% summarise(pop = sum(pop)))

ggplot(gapminder1, aes(x = reorder(continent, pop), y = pop/1000000)) + geom_col(fill = "slateblue") + theme_classic() + ylab("Численность населения 
в 1952 г., млн чел.") + xlab("") + geom_label(aes(label = round(pop/1000000,0)))

ggplot(gapminder1,aes(area=pop, fill=continent, label = continent)) + 
  treemapify::geom_treemap(layout="squarified")+
  geom_treemap_text(place = "centre",size = 12) + scale_fill_manual(values = c("#ed7d70", "#ec121f", "#bac1c9", "#686461", "#0b0709")) + ggtitle("Численность населения в 1952 г., млн чел.")