Skip to content

Instantly share code, notes, and snippets.

View gabrielzanlorenssi's full-sized avatar
🐊

Gabriel Zanlorenssi gabrielzanlorenssi

🐊
View GitHub Profile
# Library -----------------------------------------------------------------
library(cepespR)
library(tidyverse)
#-- 1998 a 2018
years <- c(1998, 2002, 2006, 2010, 2014, 2018)
d <- map_df(years, function(x) {
get_votes(year=x, position="President") %>%
# Bibliotecas -------------------------------------------------------------
library(tidyverse)
library(sf)
library(jsonlite)
# Configuracao dos municipios ---------------------------------------------
urlm = "https://resultados.tse.jus.br/oficial/ele2022/544/config/mun-e000544-cm.json"
muni_tse <- fromJSON(urlm,
library(rvest)
library(tidyverse)
#-- links
url = "https://www.camara.leg.br/internet/sitaqweb/resultadoPesquisaDiscursos.asp?txIndexacao=&CurrentPage=19&BasePesq=plenario&txOrador=JAIR%20BOLSONARO&txPartido=&dtInicio=&dtFim=&txUF=&txSessao=&listaTipoSessao=&listaTipoInterv=&inFalaPres=&listaTipoFala=&listaFaseSessao=&txAparteante=&listaEtapa=&CampoOrdenacao=dtSessao&TipoOrdenacao=DESC&PageSize=50&txTexto=&txSumario="
url %>%
read_html(url) %>%
html_nodes("a") %>%
# Pacotes -----------------------------------------------------------------
library(tidyverse)
library(jsonlite)
# Configuracao dos municipios ---------------------------------------------
urlm = "https://resultados.tse.jus.br/oficial/ele2022/544/config/mun-e000544-cm.json"
# Pacotes -----------------------------------------------------------------
library(tidyverse)
library(jsonlite)
# Configurar --------------------------------------------------------------
#-- codigo pleito
# Pacotes -----------------------------------------------------------------
library(tidyverse)
library(jsonlite)
# Configurar --------------------------------------------------------------
#-- codigo pleito
# pleito = 544 # 1t !! (usar esse para teste) !!
# Resultados copa ---------------------------------------------------------
library(tidyverse)
library(readxl)
library(googlesheets4)
url = "https://docs.google.com/spreadsheets/d/1m9fPRyk5fNVP7CXuVw2MqF3ZGAMbFFhceTsEoYSCUy4/edit#gid=0"
sheets <- read_sheet(url)
library(tidyverse)
library(readxl)
library(rvest)
library(httr)
library(xml2)
library(lubridate)
library(sf)
# Scrap API ---------------------------------------------------------------