Publications by Nguyen Chi Dung
Vietnam ’s fertility rate
Economist-Style Plot using R The graph was created by the Economist and can be replicated by using R as follows: R Codes for Data Cleaning and Visualization rm(list = ls()) # Package for data manipulation: library(tidyverse) # Load wbstats package: library(wbstats) # A list of indicators: my_indicator <- c("SP.DYN.TFRT.IN", "SP.POP.TOTL", "...
10731 sym R (7162 sym/1 pcs) 1 img
Origin of crude oil imported to China
Economist-Style Plot using R The graph is motivated by Economist’s plot and can be replicated by using R as follows: R Codes for Data Cleaning and Visualization In this post I use uspopage data set from gcookbook package for illustrative purpose. rm(list = ls()) library(tidyverse) library(gcookbook) library(scales) my_colors <- c("#A8A9AD", "...
8017 sym R (4974 sym/1 pcs) 1 img
Matters of the heart
Economist-Style Plot using R Origin of the plot can be found here. This plot can be replicated by using R as follows: R Codes for Data Cleaning and Visualization Data can be downloaded here. # Load Data: library(tidyverse) df <- read.table("/home/khanhan/Downloads/NCD_RisC_Lancet_2016_BP_age_standardised_countries.txt", sep = ",") df %>% select...
7869 sym R (4938 sym/1 pcs) 1 img
Global terrorism, 2000 - 2014 (Version 2)
ABCNews-Style Plot using R Origin of the plot can be found here. This plot can be replicated by using R as follows: R Codes for Data Cleaning and Visualization Data can be downloaded here. # https://www.abc.net.au/news/2015-11-17/global-terrorism-index-increase/6947200 my_colors <- c("#770A1F", "#EC1D27", "#F56F52", "#F9B297") my_colors <- my_c...
8835 sym R (5613 sym/1 pcs) 1 img
Global terrorism, 2000 - 2014 (Version 1)
Economist-Style Plot using R Origin of the plot can be found here. This plot can be replicated by using R as follows: R Codes for Data Cleaning and Visualization Data can be downloaded here. # Load data: library(tidyverse) dfRaw <- read_csv("/home/khanhan/Downloads/globalterrorismdb_0718dist.csv") # Western Countries: library(rvest) read_ht...
6425 sym R (3796 sym/1 pcs) 1 img
Greying of the Nobel laureates
Economist-Style Plot using R Origin of the plot can be found here. This plot can be replicated by using R as follows: R Codes for Data Cleaning and Visualization #======================================================================================= # References: # https://www.economist.com/graphic-detail/2016/10/03/greying-of-the-no...
7048 sym R (4413 sym/1 pcs) 1 img
Gender Pay Gap by Britain Banks
Gender Pay Gap by Bank #========================================================== # References: https://www.bbc.com/news/business-43668187 #========================================================== # Load some packages: library(tidyverse) # Simulate a data frame: my_bonus <- data_frame(Bank = c("Barclays Bank", "Aberdeen Assets Managers", ...
3955 sym R (2477 sym/1 pcs) 1 img
Gap in Life expectancy between Male and Female
Gap in Life expectancy between Male and Female #============================== # Collect and clean data #============================== # Load some packages: library(tidyverse) library(rvest) # Extract data from link: link <- "https://en.wikipedia.org/wiki/List_of_countries_by_life_expectancy?fbclid=IwAR0jRtf0RacPLxVPgcuu4zgYJl9HDk01cNy6u48...
6347 sym R (4207 sym/1 pcs) 1 img
Life expectancy gender gap, 2018
Life expectancy at birth by gender #============================== # Collect and clean data #============================== # Load some packages: library(tidyverse) library(rvest) # Extract data from link: link <- "https://en.wikipedia.org/wiki/List_of_countries_by_life_expectancy?fbclid=IwAR0jRtf0RacPLxVPgcuu4zgYJl9HDk01cNy6u48vvyTuoK9CC1j...
9851 sym R (6721 sym/3 pcs) 3 img
AUC or IV Criterion - Which Method is Better for Feature Engineering?
# Load some packages: library(tidyverse) library(caret) library(pROC) # Load data: data("GermanCredit") df <- GermanCredit # Set predictors and response: response <- "Class" predictors <- names(df %>% select(-response)) #=============================================================== # Scenario 1: ROC/AUC as a criterion for feature enginee...
7366 sym R (5271 sym/16 pcs) 1 img 1 tbl