This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
casos <- read_csv("https://raw.githubusercontent.com/MinCiencia/Datos-COVID19/master/output/producto15/FechaInicioSintomas_std.csv") | |
casos_agrup <- casos %>% | |
mutate(semana = str_remove(`Semana Epidemiologica`, "SE"), | |
semana = as.numeric(semana)) %>% | |
group_by(Region, semana) %>% | |
summarise(casos = sum(`Casos confirmados`)) %>% | |
ungroup() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
nuevos_por100mil <- read_csv("https://raw.githubusercontent.com/MinCiencia/Datos-COVID19/master/output/producto47/MediaMovil_std.csv") | |
nuevos_por100mil_chile <- nuevos_por100mil %>% | |
filter(Region == "Total") | |
nuevos_por100mil_regiones <- nuevos_por100mil %>% | |
filter(Region != "Total") | |
# Plot por regiones | |
nuevos_por100mil_regiones %>% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(readxl) | |
library(lubridate) | |
# Primero cargamos los datos del SIGGES. Para ello necesitas descargar la nómina de garantías cerradas y guardarla como | |
# un archivo Excel en tu computador. Guárdalo con el nombre de "cerradas" en formato xlsx. | |
cerradas <- read_excel("cerradas.xlsx", skip = 8) | |
# Ahora la limpiamos y ajustamos un poco la BD | |
cerradas %>% select(-2, -3, -10, -11, -15) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(lubridate) | |
# Descargamos los datos abiertos del covid de Chile | |
data <- read.csv("https://raw.githubusercontent.com/MinCiencia/Datos-COVID19/master/output/producto1/Covid-19_std.csv", encoding = "UTF-8") | |
# Agrupamos por comuna para calcular los casos nuevos | |
# El dataset viene con casos acumulados, por lo que hay que crear una nueva variable para obtener ese dato | |
data_agrup <- data %>% | |
group_by(Comuna) %>% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(shiny) | |
library(tidyverse) | |
library(lubridate) | |
library(zoo) | |
library(forecast) | |
library(shinythemes) | |
library(plotly) | |
# Descargamos los datos abiertos del covid de Chile | |
data <- read.csv("https://raw.githubusercontent.com/MinCiencia/Datos-COVID19/master/output/producto1/Covid-19_std.csv", encoding = "UTF-8") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
# Descarga de datasets | |
vacuna1 <- read_csv("https://raw.githubusercontent.com/MinCiencia/Datos-COVID19/master/output/producto81/vacunacion_comuna_edad_1eraDosis.csv") | |
vacuna2 <- read_csv("https://raw.githubusercontent.com/MinCiencia/Datos-COVID19/master/output/producto81/vacunacion_comuna_edad_2daDosis.csv") | |
# Limpeza y transformación de los datos | |
vacuna1 <- vacuna1 %>% filter(!str_detect(string = Comuna, pattern = "Desconocido")) | |
vacuna2 <- vacuna2 %>% filter(!str_detect(string = Comuna, pattern = "Desconocido")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rvest) | |
library(tidyverse) | |
# Get catalogue | |
list_products <- data.frame() | |
for (page_result in seq(from = 1, to = 3, by = 1)) { | |
url <- paste0("https://www.pcfactory.cl/notebooks?categoria=735&papa=636&pagina=", page_result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install.packages("diffr") | |
library(diffr) | |
diffr("example_script1.R", "example_script_2.R") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
ges <- ges_df %>% | |
mutate(problema_de_salud = str_remove(problema_de_salud, pattern = "(\\s?[.]?\\s?[{]\\w+\\s\\w+.\\s?\\d+.?\\d+.)")) |
OlderNewer