Skip to content

Instantly share code, notes, and snippets.

View RHDZMOTA's full-sized avatar
👨‍💻
More info at: rhdzmota.com

Rodrigo H. Mota RHDZMOTA

👨‍💻
More info at: rhdzmota.com
View GitHub Profile
@RHDZMOTA
RHDZMOTA / dataviz_whatsapp.R
Last active April 1, 2016 04:29
This code generates visualizations of whatsapp's logs analysis. Two things are needed in the working directory: whatsapp's log file (.txt without media) and whatsapp_functions.R
# Whatsapp's data visualization
# by: Rodrigo Hernández Mota
# file name: dataviz_whatsapp.R
# V.1.0.0
# General structure
# This file was structured as data exploration process
# was developing. For such reason, the main sections
# contained and the visualizations are divided in:
# - word frequency
@RHDZMOTA
RHDZMOTA / dataviz_radarplot.R
Last active April 7, 2021 04:02
Create radar plot of the data: Consumption of pure alcohol by type of beverage. The following files are needed in the working directory: alcohol_data_download.R and data_cleaning.R
# Code to generate radar plot.
# Load required data and variables
source("alcohol_data_download.R")
source("data_cleaning.R")
# functions ---------------------------------------------------------------
library(ggplot2)
@RHDZMOTA
RHDZMOTA / alcohol_data_download.R
Last active January 9, 2025 12:18
Download and clean data from the World Health Organization - Global Health Observatory: Consumption of pure alcohol by type of beverage. The database contains data from 2010 of nearly 50 different countries.
# Radar Plots
# Example: consumption of pure alcohol by type of beverage
library(tibble)
# Download data -----------------------------------------------------------
# Data by country and type of beverage
url <- "http://apps.who.int/gho/athena/data/data-text.csv?target=GHO/SA_0000001398&profile=text&filter=COUNTRY:*;REGION:EUR;ALCOHOLTYPE:*"
# Download and read files