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(dplyr) | |
setwd("~/GitHub/oleogate/data") | |
#Extrai tabelas do arquivo pdf. | |
#Esse arquivo foi baixado do seguinte link | |
# https://politica.estadao.com.br/blogs/estadao-verifica/wp-content/uploads/sites/690/2019/10/Ibama.pdf | |
#A tabela é extraída para um arquivo csv de forma a poder trabalhar melhor questões de encoding | |
tabulizer::extract_tables("ibama.pdf", output = "csv",outdir = getwd()) |
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
# install.packages("devtools") | |
devtools::install_github("tchiluanda/rsiconfi") | |
library(rsiconfi) | |
library(dplyr) | |
library(tidyr) | |
###########Trabalhando as despesas | |
#Monta um vetor com todos os códigos de UFs do Brasil |
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
# Força o encoding para UTF-8, default do banco de dados | |
# Colaboração de Sérgio Spagnuolo ([email protected]) | |
# Programa acessar a API do Atlas da Notícia (https://www.atlas.jor.br/) | |
# É necessário antes se cadastrar, veja como aqui: https://www.atlas.jor.br/plataforma/utilizarAPI/ | |
library(httr) | |
library(jsonlite) | |
# Puxa os dados da sua credencial | |
token = content( |
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(readr) | |
library(dplyr) | |
PENSIONISTAS_112019 <- read_delim("Data/PENSIONISTAS_112019.csv", | |
";", escape_double = FALSE, locale = locale(decimal_mark = ",", | |
grouping_mark = ".", encoding = "LATIN1"), | |
trim_ws = TRUE) | |
PENSIONISTAS_122019 <- read_delim("Data/PENSIONISTAS_122019.csv", | |
";", escape_double = FALSE, locale = locale(decimal_mark = ",", |
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
#based on this method: https://github.com/k-sys/covid-19/blob/master/Realtime%20R0.ipynb | |
# In fact it is a translation from python to R of some parts of the code explained in the link above. | |
get_last_covid_rt<- function(df_days_case){ #this dataset must have a structre with a collumn no_cases (accumulated number of cases on a given sequence day) | |
#smooth the data | |
x <- 1:NROW(df_days_case) | |
y<-df_days_case$no_cases |
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
### STOPWORDS IN PORTUGUESE | |
## Create a unique dataset from several datasets with stopwords in Portuguese | |
# Lucas Gelape | |
# Packages | |
library(dplyr) | |
library(stringi) | |
library(readr) |
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(ckanr) | |
library(purrr) | |
ckanr::package_search() | |
package<- ckanr::package_show(id= "22d13d17-bf69-4a1a-add2-25cc1e25f2d7", | |
url= "https://www.tesourotransparente.gov.br/ckan") #busca todos os dados do dataset que se refere aos dados de COFOG | |
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
##################################################### | |
# Use GPT-3 in R with the OpenAI API. You need to install the reticulate package. | |
# Additionally, an API key is required that must be saved in a separate file, called .openaikey | |
# Get your API key here: https://openai.com/api/ | |
##################################################### | |
# install.packages("reticulate") # run only once | |
library(reticulate) | |
# create python env |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer