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
# Baixei os dados em: https://censo2022.ibge.gov.br/panorama/ | |
# Baixei os dados para Osasco | |
library(ggplot2) | |
piramide_etaria <- | |
readr::read_delim( | |
"dados/censo-2022/Censo 2022 - Pirâmide etária - Osasco (SP).csv", | |
delim = ";", | |
escape_double = FALSE, | |
trim_ws = TRUE | |
) |> |
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
# Exploring R-Ladies Chapters in Australia! | |
# By: Beatriz Milz - beamilz.com | |
# R-Ladies events dataset: | |
# https://raw.githubusercontent.com/rladies/meetup_archive/main/data/events.json | |
# Filtered by only events that have lat/long in the dataset. | |
# Getting the polygon for Australia ---- | |
temporary_dir <- fs::path_temp() | |
data_world <- geodata::world(path = temporary_dir) |
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
# instalar o pacote | |
# install.packages("basedosdados") | |
# carregar o pacote base dos dados | |
library(basedosdados) | |
# Aqui embaixo | |
set_billing_id("base-dos-dados-334420") | |
# carregar os dados de id_municipio |
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
# Sobre esse script ------------------------------------- | |
# Este código foi utilizado para sortear os brindes do evento de 20/02/2024, | |
# organizado pela R-Ladies São Paulo. | |
# Autoria: Beatriz Milz | |
# Data: 20/02/2024 | |
# Comentário sobre reprodutibilidade: esse código não é reprodutível, | |
# por dois fatores: 1) o formulário de inscrição não está compartilhado com | |
# todas as pessoas, apenas as co-organizadoras do evento. Esse formulário | |
# tem dados sensíveis sobre participantes. 2) O sorteio não foi feito usando | |
# a função set.seed() - portanto, a cada vez que executar o código de sorteio, |
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
# Dúvida do Nathan Oliveira: Como ler arquivos .dbc? | |
# Existe um pacote chamado read.dbc, | |
# ele é usado pelo pacote microdatasus | |
# Referência: https://github.com/danicat/read.dbc | |
# esse pacote NÃO está disponível no CRAN | |
# precisa instalar o pacote remotes | |
# o remotes tem funções para instalar pacotes direto do GitHub | |
install.packages("remotes") |
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
# Gráfico: Eventos da R-Ladies São Paulo | |
# Criado por Beatriz Milz | |
# Instagram: @dadoseambiente | |
# GitHub: @beatrizmilz | |
library(tidyverse) | |
# Criando manualmente uma tabela com os dados | |
# Na tabela temos a frequencia de eventos online e presenciais, em cada ano. | |
frequencia_eventos <- tribble( |
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
# Dúvida da Carla Graciane: Como buscar a localização de estabelecimentos de saúde? | |
# A pergunta foi feita após a apresentação sobre o geobr no Meetup da R-Ladies SP | |
# Meetup: https://r-ladies-sao-paulo.github.io/2023-11-pacotes-br/slides.html | |
# Apresentação geobr: https://r-ladies-sao-paulo.github.io/2023-11-pacotes-br/slide-geobr.html | |
# Encontrei a função read_health_facilities() | |
# RECOMENDO ler essa página de documentação para entender melhor de onde vem os dados! | |
# https://ipeagit.github.io/geobr/reference/read_health_facilities.html | |
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
#' Função dplyr::arrange considerando locale pt_BR | |
# Contexto: https://blog.curso-r.com/posts/2023-03-06-ordenando-strings/ | |
arrange_br <- purrr::partial(dplyr::arrange, .locale = "pt_BR") | |
#' Função para converter números que estão em string nesse formato "1.706,23" | |
# para numeric | |
parse_number_br <- purrr::partial(readr::parse_number, | |
locale = readr::locale(decimal_mark = ",", | |
grouping_mark = ".")) |
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
# Duvida aluna Liliane (Curso-R) | |
# Obti os dados aqui! | |
# https://dadosabertos.tse.jus.br/dataset/candidatos-2022 | |
# https://cdn.tse.jus.br/estatistica/sead/odsele/consulta_cand/consulta_cand_2022.zip | |
# IMPORTANDO OS DADOS! | |
pasta <- "Downloads/consulta_cand_2022/" |
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
list_user_gists <- function(user){ | |
gists <- gh::gh("GET /users/{username}/gists", | |
username = user) | |
gists_df <- gists |> | |
purrr::map(unlist, recursive = TRUE) |> | |
purrr::map_dfr(tibble::enframe, .id = "id_gist") |> | |
tidyr::pivot_wider(id_cols = "id_gist") |> | |
janitor::clean_names() |> | |
dplyr::select(id, |
NewerOlder