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
resultado_eleicao_2024 <- read_delim("20241007_151828_eleicao24_prefeitos_vereadores_finalizados.csv", | |
delim = ";", escape_double = FALSE, trim_ws = TRUE) | |
candidatos_prefeitos_resultado<- | |
resultado_eleicao_2024 %>% | |
filter(cargo == "Prefeito") %>% | |
select(sg_partido, situacao_candidato_turno) | |
teste_chisq<- | |
chisq.test(candidatos_prefeitos_resultado$sg_partido, candidatos_prefeitos_resultado$situacao_candidato_turno,simulate.p.value = 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
library(readr) | |
library(tidyverse) | |
library(geobr) | |
library(sf) | |
library(colorspace) | |
estados_sf<- geobr::read_state() | |
resultado_eleicao_2024 <- read_delim("20241007_151828_eleicao24_prefeitos_vereadores_finalizados.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
#Simulação Toledo | |
gasto_primeira_mediana<- 2.5e6 * 100 | |
gasto_segunda_mediana_ate_2499000 <- 2499000 *681 | |
gasto_valores_pico<- 3e9 - (gasto_primeira_mediana + gasto_segunda_mediana_ate_2499000 ) | |
aposta_unitaria<- gasto_valores_pico / 1000 | |
media_simulacao<- (gasto_primeira_mediana + gasto_segunda_mediana_ate_2499000 + gasto_valores_pico)/5e6 |
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(ipeadatar) | |
library(tidyverse) | |
library(readxl) | |
series_disponiveis<- | |
ipeadatar::available_series() | |
codigos<- | |
((series_disponiveis %>% |
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
domicilio_municipios_tipo_abastecimento_agua<- | |
get_sidra(x = 6804, | |
variable = c(1000381), | |
#period = c("last" = 12), | |
geo = "City", | |
#geo.filter = "RS", | |
classific = "c301", | |
category = list(c(31471)), | |
header = FALSE, | |
format = 3) |
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(tesseract) | |
library(stringr) | |
library(tidyverse) | |
#link do arqtigo | |
#https://observatorio-politica-fiscal.ibre.fgv.br/politica-economica/outros/federacao-em-perspectiva-um-balanco-de-custos-e-beneficios-por-uf#_ftn1 | |
#faz o ocr da primeira imagem | |
text<- ocr("ma11.png") |
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
--- | |
title: "Contas Nacionais" | |
output: | |
flexdashboard::flex_dashboard: | |
theme: | |
bg: "#101010" | |
fg: "#ffda00" | |
primary: "#183eff" | |
base_font: | |
google: Prompt |
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) | |
arquivos <- list.files("data/") | |
arquivos<- paste0("data/",arquivos) | |
tabela_final<- | |
purrr::map_dfr(1:length(arquivos), function(i){ | |
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" |
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 |
NewerOlder