Read Data Vaccine

Embed library

library(glue)
library(ggrepel)
## Loading required package: ggplot2
library(ggridges)
library(ggthemes)
library(leaflet)
library(lubridate)
## 
## Attaching package: 'lubridate'
## The following objects are masked from 'package:base':
## 
##     date, intersect, setdiff, union
library(scales)
library(tidyverse)
## -- Attaching packages --------------------------------------- tidyverse 1.3.0 --
## v tibble  3.1.0     v dplyr   1.0.5
## v tidyr   1.1.3     v stringr 1.4.0
## v readr   1.4.0     v forcats 0.5.1
## v purrr   0.3.4
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x lubridate::as.difftime() masks base::as.difftime()
## x readr::col_factor()      masks scales::col_factor()
## x dplyr::collapse()        masks glue::collapse()
## x lubridate::date()        masks base::date()
## x purrr::discard()         masks scales::discard()
## x dplyr::filter()          masks stats::filter()
## x lubridate::intersect()   masks base::intersect()
## x dplyr::lag()             masks stats::lag()
## x lubridate::setdiff()     masks base::setdiff()
## x lubridate::union()       masks base::union()
library(sf)
## Linking to GEOS 3.9.0, GDAL 3.2.1, PROJ 7.2.1
library(rnaturalearth)
library(padr)
library(plotly)
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
library(magick)
## Linking to ImageMagick 6.9.12.3
## Enabled features: cairo, freetype, fftw, ghostscript, heic, lcms, pango, raw, rsvg, webp
## Disabled features: fontconfig, x11
vaccine <- read.csv("data_input/country_vaccinations.csv")
head(vaccine)

Clean Data

colSums(is.na(vaccine))
##                             country                            iso_code 
##                                   0                                   0 
##                                date                  total_vaccinations 
##                                   0                                1124 
##                   people_vaccinated             people_fully_vaccinated 
##                                1481                                2114 
##              daily_vaccinations_raw                  daily_vaccinations 
##                                1473                                 125 
##      total_vaccinations_per_hundred       people_vaccinated_per_hundred 
##                                1124                                1481 
## people_fully_vaccinated_per_hundred      daily_vaccinations_per_million 
##                                2114                                 125 
##                            vaccines                         source_name 
##                                   0                                   0 
##                      source_website 
##                                   0
vaccine_clean <- vaccine %>% 
  drop_na(total_vaccinations,people_vaccinated,people_fully_vaccinated,daily_vaccinations_raw,daily_vaccinations,total_vaccinations_per_hundred,people_fully_vaccinated_per_hundred,people_fully_vaccinated_per_hundred,daily_vaccinations_per_million)
colSums(is.na(vaccine_clean))
##                             country                            iso_code 
##                                   0                                   0 
##                                date                  total_vaccinations 
##                                   0                                   0 
##                   people_vaccinated             people_fully_vaccinated 
##                                   0                                   0 
##              daily_vaccinations_raw                  daily_vaccinations 
##                                   0                                   0 
##      total_vaccinations_per_hundred       people_vaccinated_per_hundred 
##                                   0                                   0 
## people_fully_vaccinated_per_hundred      daily_vaccinations_per_million 
##                                   0                                   0 
##                            vaccines                         source_name 
##                                   0                                   0 
##                      source_website 
##                                   0

Clean!

1.Actually i just interest how many ppl vaccinated in Indonesia

vaccine_indonesia <- vaccine_clean[vaccine_clean$country == "Indonesia", ]
vaccine_indonesia

Check the data boxplot

boxplot(vaccine_indonesia$people_vaccinated)

2.normal

Start make the visualization

aggregate(people_vaccinated ~ country, vaccine_indonesia, sum)

3.total 12348556 ppl vaccinated

ggplot(vaccine_indonesia, aes(x = people_vaccinated,
                        y = total_vaccinations,
                        size = people_vaccinated,
                        color = country)
       ) +
  geom_point() +
  scale_color_manual(values = c("red", "blue", "green"))

4.insight: between total vaccine and ppl vaccinated balance

Conclusion: 1.Actually i just interested with how many ppl vaccinated in Indonesia
2.normal
3.total 12348556 vaccinated
4.insight: between total vaccine and ppl vaccinated balance

# Based on data, 12348556 ppl vaccinated and government great to handle