Welcome to my blog
2024-03-31
1 / 3
Data Visualization
Plot multiple countries on the world map
Yang Liu
/
2023-05-29
This post will show it’s quite easy to download and plot the administrative areas of multiple countries on the world map. I will also showcase a bug that puzzled me for a long time and I recently figured out: strange connecting lines among countries! […] (You may download the world map from Github) suppressPackageStartupMessages({ library("data.table") library("ggplot2")…
Github
RMarkdown to Github Pages
Yang Liu
/
2021-01-06
Example of one of my Github pages: You might have read this GitHub and RStudio tutorial by searching this topic. It is quite long and confusing as it tries to teach Git at the same time. You don’t need any of those branch operations. And the example yaml code is not indented correctly (corrected below). Here is the short version: […] Make sure the yaml format is indented correct. Most…
Data Visualization
US and China Admin1 COVID19 mortality and incidence rate
Yang Liu
/
2020-06-14
Similar to the last heatmap post I just revised, here I wrapped up the function and showing COVID-19 data just downloaded from JHU CSSE Github page. The function can take a given dataset and plot designated variable. Code hosted on my Github repo. […] # major function, can download from Github repo Blogdown/hugo-xmag/Code source(here::here("Code/COVID_make_map.R")) # US dt_JUH_US…
Data Visualization
ggplot US state and China province heatmap
Yang Liu
/
2020-06-12
(Updated on 2020-06-12, First posted on 2019-04-17) It sounds easy but turned out not as straight-forward as I thought. I will show: […] 50-state (including Alaska and Hawaii) United States thematic map, with map scale and with state abbreviations […] China thematic map, with map scale, with names of provinces in either English or Chinese […] The dt1 below can be used by both…
Data Engineering
Working with 3D array as long-format data in R
Yang Liu
/
2020-01-11
check.and.install.pkgs <- function(pkgs){ new.packages <- pkgs[!pkgs %in% installed.packages()[,"Package"]] if(length(new.packages)) install.packages(new.packages, dependencies = TRUE) suppressPackageStartupMessages(invisible(lapply(pkgs, library, character.only = TRUE))) } check.and.install.pkgs(c("data.table", "reshape2", "scatterplot3d")) Happy New…
Reproducible Workflow
Drake: powerful tool for automatic reproducible workflow
Yang Liu
/
2019-09-15
drake is a powerful tool for automatic reproducible workflow. I found it a perfect match when used together with RMarkdown. There are great documentations online for drake thus here I only show a simple example working with RMarkdown. RMarkdown file could be very slow to generate if lots of calculations are involved. Any small revise makes you rerun everything. When we use drake we can do all the…
««
«
1
2
3
»
»»