These plots are based on a modified theme_grey and data are retrieved from ourworldindata.org’s github repo.
Code as a gist:
[Tovább/More]
**Hello World!**
Weighted survey means
European Social Survey plotting exercise
The following simple example will use European Social Survey (ESS) integrated datafile in order to plot unweighted and weighted distribution of the generalized trust variable (ppltrst). Here are the two plots. The underlying codes demonstrate how to use srvyr and dplyr to work together on survey data. R can be...
[Tovább/More]
A simple demo of lag and lead functions
with reference to time-series analysis
Sometimes one needs to create new variables by finding the “previous” (lag()) or “next” (lead()) values in a vector (e.g. in a df column). A real-world example is first order differencing in a time-series analysis
[Tovább/More]
Multi-line chart - number of COVID deaths in V4 countries
ggplot, line chart, V4 countries, COVID-19
I would like to highlight here the charting capabilities of ggplot, that are based on different layers containing geoms (lines, points, bars, etc). There is at least one “aesthetic mapping” that describes how variables in the data are mapped to geoms in the basic ggplot() declaration. However, additional mappings can...
[Tovább/More]
Data wrangling in R (tidyverse)
pivoting, select, filter, rename functions
Data wrangling is the process of shaping data into a format that is appropriate for specific analytical purposes. In the following example we shall read John Hopkins University’s (JHU) COVID-19 deaths database. It contains daily cumulative number of COVID-19 deaths for countries, and in some cases (like USA) for provinces/states....
[Tovább/More]