This file contains hidden or 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
--- | |
title: "Contas Nacionais" | |
output: | |
flexdashboard::flex_dashboard: | |
theme: | |
bg: "#101010" | |
fg: "#ffda00" | |
primary: "#183eff" | |
base_font: | |
google: Prompt |
This file contains hidden or 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) | |
arquivos <- list.files("data/") | |
arquivos<- paste0("data/",arquivos) | |
tabela_final<- | |
purrr::map_dfr(1:length(arquivos), function(i){ | |
This file contains hidden or 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" |
This file contains hidden or 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 |
This file contains hidden or 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" | |
This file contains hidden or 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" |
This file contains hidden or 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) |
This file contains hidden or 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") |
This file contains hidden or 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") |
This file contains hidden or 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) |