View grafico-genero-cargo-candidatos-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
# 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/" |
View function_to_download_gists
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, |
View funcao-buscar-dados-votacoes.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
# Funcao para 1 dia ------------------------- | |
buscar_dados_votacao <- function(data) { | |
# url da API | |
base <- | |
"https://legis.senado.leg.br/dadosabertos/plenario/lista/votacao/" | |
json <- jsonlite::fromJSON(paste0(base, data)) | |
dados <- json |> | |
purrr::pluck("ListaVotacoes") |> |
View twitch.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
# AUTENTICAR NA TWITCH VIA R -------------------------------------------- | |
# O que está na documentação: | |
# GET https://id.twitch.tv/oauth2/authorize | |
# ?client_id=<your client ID> | |
# &redirect_uri=<your registered redirect URI> | |
# &response_type=<type> | |
# &scope=<space-separated list of scopes> | |
# Adaptando isso para o que precisamos... |
View 20210421_netflix_tidytuesday.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
#' Author: Bea | |
#' Subject: Tidytuesday de 20 de abril de 2021 | |
library(magrittr, include.only = "%>%") | |
library(ggplot2) | |
# Import ---------------------------------------------------------------------- | |
netflix <- | |
readr::read_csv( | |
'https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-04-20/netflix_titles.csv' |
View get_templates_packages.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
#' Copy templates from packages | |
#' | |
#' @param path Character: a path where the files will be copied | |
#' @param pacote name of the package that contains the template | |
#' @param template name of the template: thesis, resume, poster-relaxed, | |
#' poster-jacobs, card ... | |
#' @return | |
#' @export | |
#' | |
#' @examples get_templates_packages("template/", "pagedreport", "windmill") |
View sorteio_rladies_marco2021.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
# Código para realizar o sorteio! | |
# Carregar o pipe | |
library(magrittr, include.only = "%>%") | |
# Endereço da planilha gerada pelo Google Forms | |
url <- "https://docs.google.com/spreadsheets/d/1B4VPVsBsJYHVGlXJpKGs-p6fZj7pu-Vlnofpibg1RLc/edit?usp=sharing" | |
# Lê as respostas. | |
# Apenas quem tem acesso a este arquivo vai conseguir fazer essa etapa. | |
# É necessário autenticar! |
View 20210128_grafico_cantareira.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
#' Author: Beatriz Milz | |
#' Subject: Gráfico do volume armazenado no Sistema Cantareira. Dados da sabesp, | |
#' disponíveis no pacote mananciais. | |
library(readr) | |
library(ggplot2) | |
library(magrittr) | |
# Import ----------------------------------------------------------------------- |