View consome_api_dados_gov_br.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(jsonlite) | |
# load the httr package | |
library(httr) | |
#Você deve ter uma chave gerada de API. Para isso você precisa criar um usuário na página dados.gov.br usando o gov.br | |
my_key<- "<sua_chave_aqui>" | |
# Define the API endpoint and headers | |
url <- "https://dados.gov.br/dados/api/publico/conjuntos-dados" |
View southamerica_brazil_map.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(readxl) | |
library(geobr) | |
library(tidyverse) | |
library(sf) | |
library(spData) | |
library(ggrepel) | |
get_municipalies_data<- function(){ | |
# Load required libraries |
View ibge_municipios_2022.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
gera_tabela_ibge_municipios<- function(){ | |
# Load required libraries | |
library(httr) | |
library(jsonlite) | |
library(janitor) | |
library(tidyverse) | |
# API endpoint URL | |
api_url <- "https://apisidra.ibge.gov.br/values/t/4714/n6/all/v/all/p/all/d/v614%202" | |
View genero_raca_sih.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(microdatasus) | |
library(tidyverse) | |
ano_inicio<- 2020 | |
ano_fim <- 2020 | |
mes_inicio<-12 | |
mes_fim<-12 | |
estado<- "GO" |
View pepito_the_cat.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(rtweet) | |
library(tidyverse) | |
library(lubridate) | |
library(colorspace) | |
library(ggpattern) | |
library(ggTimeSeries) | |
library(patchwork) | |
pepito<- rtweet::get_timeline(user = "@PepitoTheCat",n=3200) |
View trata_cime.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("tabulizer") | |
library("tidyverse") | |
library(readr) | |
cime_total<- tabulizer::extract_text("cime-20.01.pdf") | |
pos_ini<- | |
str_length("Secretaria de Estado de Administração Penitenciária do Distrito Federal\r\nCentro de Monitoração Eletrônica - CIME\r\n") |
View listasdojeff.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(rtweet) | |
#As 100 mais recentes listas do Jeff | |
listas_jeff<- rtweet::lists_users(user = "jnascim", reverse = TRUE) | |
#Dados de twitter sobre os membros da 56ª legislatura da câmara | |
members_camara_leg_56<- rtweet::lists_members(list_id = "1093197444874153985") | |
#Dados de twitter sobre membros da 56ª legislatura do senado | |
members_senado<- rtweet::lists_members(list_id = "1091163823858503685") |
View discursos_deputados.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(jsonlite) | |
library(purrr) | |
legislatura<-"56" | |
#Endereço básico para capturar todos os deputados de uma legislatura | |
path<- "https://dadosabertos.camara.leg.br/api/v2/deputados?idLegislatura=%s&ordem=ASC&ordenarPor=nome" | |
path<- sprintf(path, legislatura) |
View goodvibes.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) | |
library(colorspace) | |
library(ggrepel) | |
set.seed(13) | |
good_vibes <- rnorm(n=100, mean=90, sd=2) | |
set.seed(22) | |
bad_vibes <- rnorm(n=100, mean=70, sd=2) | |
View trata_mensagens_whats_app.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(stringr) | |
library(purrr) | |
library(readr) | |
file_txt<- "<Nome_do_arquivo_baixado.txt>" | |
conversa_txt <- readLines(file(file_txt , encoding = "UTF8")) | |
id_linhas_sujas<- |
NewerOlder