Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

Latest commit

 

History

History
42 lines (30 loc) · 1.08 KB

eda_undersecretaries.md

File metadata and controls

42 lines (30 loc) · 1.08 KB

Exploratory Data Analysis

Packages and Data

## Packages
library(DataExplorer)
library(ggplot2)

## Data
data_CHL <- read.csv("../data/tidy/chl_undersecretaries.csv", encoding = "UTF-8")

Data Set Plot

plot_intro(data_CHL, ggtheme = theme_minimal(base_size = 12),
           theme_config = theme(legend.position = "none")) 

Discrete Variables

selection_var1 <- drop_columns(data_CHL, c("id", "country", "name", "start_president", "end_president",
                                           "ministry", "undersec", "start_undersec", "end_undersec"))
plot_bar(selection_var1, ggtheme = theme_minimal(base_size = 12))

Time Variable

data_CHL$time <- with(data_CHL, (as.Date(data_CHL$end_undersec) - as.Date(data_CHL$start_undersec)))
data_CHL$time <- as.numeric(data_CHL$time)
plot_histogram(data_CHL$time, ggtheme = theme_minimal(base_size = 12))