Skip to content

Instantly share code, notes, and snippets.

View jmcastagnetto's full-sized avatar
馃嚨馃嚜
Focusing

Jesus M. Castagnetto jmcastagnetto

馃嚨馃嚜
Focusing
View GitHub Profile
@jmcastagnetto
jmcastagnetto / test-katex.Rmd
Created July 13, 2021 00:02
Testing the rOpenSci {katex} package
---
title: "Testing rOpenSci katex"
author: "Jesus M. Castagnetto"
date: "2021-07-12"
output:
html_document:
mathjax: null
---
```{r setup, include=FALSE}
@jmcastagnetto
jmcastagnetto / theme.rstheme
Created July 14, 2021 02:09
Fragment to add to an *.rstheme to get Okabe-Ito colored "rainbow" parentheses
/* this is just a fragment to change the color of the "rainbow" color parentheses */
/* the colors below come from the Okabe-Ito palette */
.ace_paren_color_0 {
color: #000000 !important; /* black */
font-weight: bold;
}
.ace_paren_color_1 {
color: #e69f00 !important; /* orange */
font-weight: bold;
}
@jmcastagnetto
jmcastagnetto / diferencias.txt
Created August 6, 2021 03:38
Diferencias en datos de vacunaci贸n entre commits a74908 y b7ef70, para datos/vacunas_covid_resumen.csv (https://github.com/jmcastagnetto/covid-19-peru-vacunas/)
# Generado usando daff
--- a/datos/vacunas_covid_resumen.csv
+++ b/datos/vacunas_covid_resumen.csv
@@,fecha_corte,fecha_vacunacion,fabricante,dosis,n_reg
,2021-08-03,2021-02-08,PFIZER,1,1
->,2021-08-03,2021-02-09,SINOPHARM,1,1946->3845
->,2021-08-03,2021-02-10,SINOPHARM,1,7551->16583
,2021-08-03,2021-02-11,PFIZER,1,2
->,2021-08-03,2021-02-11,SINOPHARM,1,16792->34108
,2021-08-03,2021-02-12,ASTRAZENECA,1,1
@jmcastagnetto
jmcastagnetto / README.md
Last active August 21, 2021 18:06
Intento de encontrar un esquema para los datos de la Datat贸n 2021 del MINSA

Datat贸n 2021 del MINSA

Esta informaci贸n trata de diagramar un esquema aproximado de (casi) todos los datos que se han liberado hasta la fecha para la Datat贸n 2021 del MINSA.

Me he basado en las estructuras de los datos, en particular los datos de tb_persona y un campo id_persona, que es referido en varios de los CSVs que han sido puestos como datos abiertos.

Tambi茅n he puesto varios FK entre tablas, en base a los nombres. No he revisado que todos los FK funcionen con todos los datos que se han liberado, pero al menos, funciona el tener tb_sinadef.id_persona -> tb_persona.id_persona (por ejemplo).

@jmcastagnetto
jmcastagnetto / README.md
Last active August 21, 2021 23:49
Informaci贸n extra de los linajes de SARS-COV-2 detectados en Per煤

Usando los datos del "Dataset de Pruebas Moleculares del Instituto Nacional de Salud - INS" al 2021-08-20, y combinando la informaci贸n con datos de https://cov-lineages.org/lineage_list.html, a continuaci贸n se tiene la informaci贸n extendida de los linajes de SARS-COV-2 en Per煤, hasta la fecha.

El campo de frequency tiene el n煤mero de registros que mencionan un linaje en particular, y el de result tiene el valor consignado originalmente en el dataset del INS mencionado arriba.

Estructura de datos

name width type
lineage 12 str
frequency 11 int
@jmcastagnetto
jmcastagnetto / fragment-settings.json
Created September 20, 2021 15:59
Changes in VSCode "settings.json" to get "rainbow brackets" with Okabe-Ito colorblind-friendly colors in light themes
// compatible with VSCode version 1.60.1 (or later)
"workbench.colorTheme": "Default Light+",
"editor.bracketPairColorization.enabled": true,
"workbench.colorCustomizations": {
// Okabe-Ito colors (colorblind-friendly)
"editorBracketHighlight.foreground1": "#000000", // black
"editorBracketHighlight.foreground2": "#e69f00", // orange
"editorBracketHighlight.foreground3": "#56b4e9", // sky blue
"editorBracketHighlight.foreground4": "#009e73", // bluish green
"editorBracketHighlight.foreground5": "#0072b2", // blue
@jmcastagnetto
jmcastagnetto / 9 - Julia is fast (modified).ipynb
Last active December 6, 2021 13:28
Notebook benchmarking C, Python, Julia and R
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jmcastagnetto
jmcastagnetto / covid19-peru-positivos-fallecidos.R
Created December 29, 2021 17:41
COVID19 (Per煤): Gr谩ficos de positivos y fallecidos por semana epidemiol贸gica
# Inspirado en https://twitter.com/plenque/status/1475934854269259803
library(tidyverse)
library(lubridate)
pos_url <- "https://github.com/jmcastagnetto/covid-19-peru-limpiar-datos-minsa/raw/main/datos/positivos_covid_aumentado.rds"
pos <- rio::import(pos_url)
pos_semana <- pos %>%
mutate(
@jmcastagnetto
jmcastagnetto / covid19-new-cases-nyt-spiral-graph.R
Created January 10, 2022 20:29
Una versi贸n del gr谩fico espiral del NYT para los nuevos casos COVID-19 del Per煤
# Ref: https://bydata.github.io/nyt-corona-spiral-chart/
# https://github.com/bydata/nyt-corona-spiral-chart/blob/main/spiral-chart.R
library(tidyverse)
library(lubridate)
library(ggtext)
library(patchwork)
owid_url <- "https://github.com/owid/covid-19-data/blob/master/public/data/owid-covid-data.csv?raw=true"
country <- "Peru"
@jmcastagnetto
jmcastagnetto / preproc-data.R
Created January 12, 2022 15:48
Cruzar datos de positivos con vacunados (COVID-19, Peru - basado en datos abiertos del MINSA")
library(tidyverse)
library(arrow)
# RDS de https://github.com/jmcastagnetto/covid-19-peru-limpiar-datos-minsa
positivos <- readRDS("tmp/positivos_covid_aumentado.rds") %>%
select(id_persona, fecha_resultado, metododx) %>%
distinct() %>%
mutate(
id_persona = as.integer(id_persona)
)