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(ggdist) | |
library(glue) | |
library(ggtext) | |
#url <- "https://www.fonasa.cl/sites/fonasa/datos-abiertos/bases-grd" | |
# Unzip file | |
unzip("raw-data/2022.zip", exdir = "raw-data/") |
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(arrow) | |
url <- "https://datos.gob.cl/dataset/606ef5bb-11d1-475b-b69f-b980da5757f4/resource/ae6c9887-106d-4e98-8875-40bf2b836041/download/at_urg_respiratorio_semanal.parquet" | |
download.file(url, "raw-data/at_urg_respiratorio_semanal.parquet", mode = "wb") | |
df <- arrow::read_parquet("raw-data/at_urg_respiratorio_semanal.parquet") | |
influenza_hospitales <- df |> |
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(finalfit) | |
library(survival) | |
melanoma <- boot::melanoma | |
melanoma <- melanoma |> | |
mutate( | |
status_os = if_else(status == 2, 0, | |
1 |
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(ggdark) | |
urls <- c( | |
"https://repositoriodeis.minsal.cl/DatosAbiertos/VITALES/PUBLICADA%20NOV%202022%20MDC/Serie_Nacimientos_1992_2000.zip", | |
"https://repositoriodeis.minsal.cl/DatosAbiertos/VITALES/PUBLICADA%20NOV%202022%20MDC/Serie_Nacimientos_2001_2019.zip", | |
"https://repositoriodeis.minsal.cl/DatosAbiertos/VITALES/PUBLICADA%20NOV%202022%20MDC/DA_Nacimientos_2020.zip" | |
) | |
file_names <- c("nacimientos1.zip", "nacimientos2.zip", "nacimientos3.zip") |
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
# Load necessary libraries | |
library(tidyverse) # For data manipulation | |
library(survival) # For survival analysis | |
library(survminer) # For survival visualization | |
# Load TidyTuesday data for the 5th week of 2023 | |
data <- tidytuesdayR::tt_load(2023, week = 05) | |
# Extract relevant datasets | |
cats_uk <- data$cats_uk |
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) | |
library(lubridate) | |
url <- "https://www.empleospublicos.cl/pub/convocatorias/convocatorias.aspx" | |
web <- read_html(url) | |
job <- web |> | |
html_nodes("#bx_titulos") |> |
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
## Chinese Zodiac | |
# More info https://www.travelchinaguide.com/intro/astrology/60year-cycle.htm | |
chinese_zodiac <- function(year) { | |
elements <- list("madera", "fuego", "tierra", "metal", "agua") | |
animals <- list("rata", "buey", "tigre", "conejo", "dragón", "serpiente", "caballo", "oveja", "mono", "gallo", "perro", "cerdo") | |
if (year < 604) { |
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) | |
url <- "https://sdmx.oecd.org/public/rest/data/OECD.ELS.HD,DSD_HEALTH_STAT@DF_LE,1.0/all?dimensionAtObservation=AllDimensions&format=csvfilewithlabels" | |
data <- read_csv(url) | |
first_last_values <- data |> | |
filter( | |
`Reference area` == "Chile", | |
Measure == "Life expectancy", |
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) | |
# URL for the dataset | |
url <- "https://raw.githubusercontent.com/github/innovationgraph/main/data/languages.csv" | |
# Read the dataset | |
data <- read_csv(url) | |
# Perform data manipulation and aggregation | |
p <- data |> |
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(httr) | |
library(jsonlite) | |
library(dplyr) | |
url <- "https://datos.gob.cl/api/3/action/datastore_search?resource_id=2c44d782-3365-44e3-aefb-2c8b8363a1bc" | |
# Option A: paginated download | |
download_paginated_data <- function(url) { | |
all_data <- list() | |
offset <- 0 |
NewerOlder