Skip to content

Instantly share code, notes, and snippets.

View schoulten's full-sized avatar

Fernando da Silva schoulten

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@schoulten
schoulten / images
Created September 26, 2020 21:48
images
images
@schoulten
schoulten / create-logo.R
Created March 13, 2021 12:53
Create R Package Logo
# Load packages
library(hexSticker)
library(cowplot)
library(showtext)
# Add a great Google Font
font_add_google("Do Hyeon")
@schoulten
schoulten / data-viz.R
Created March 15, 2021 11:33
Ministros da Saúde no Brasil: dias no cargo
# Load packages -----------------------------------------------------------
library(tidyverse)
library(magrittr)
library(readxl)
library(lubridate)
library(bbplot) # devtools::install_github('bbc/bbplot')
@schoulten
schoulten / ARG.png
Last active September 10, 2021 14:39
country_flags
ARG.png
@schoulten
schoulten / import_pbf_pagmt.R
Created January 18, 2022 14:25
Importar dados do Bolsa Família (Pagamentos)
# Função que baixa e importa dados do Bolsa Família (Pagamentos) do
# Portal Transparência/CGU, apontando ano (4 digitos) e mês (2 dígitos)
import_pbf_pagmt <- function(year, month){
# URL para acesso aos arquivos
base_url <- paste0(
"http://www.portaltransparencia.gov.br/",
"download-de-dados/bolsa-familia-pagamentos/"
)
report_ndiffs <- function (
x,
test = c("kpss", "adf", "pp"),
term = c("level", "trend"),
alpha = 0.05,
na_rm = TRUE
) {
# All possible tests and terms
ndiffs_tests <- purrr::cross(list(test = test, type = term))