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(tidyverse) | |
library(colorspace) | |
library(ggrepel) | |
set.seed(13) | |
good_vibes <- rnorm(n=100, mean=90, sd=2) | |
set.seed(22) | |
bad_vibes <- rnorm(n=100, mean=70, sd=2) | |
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(stringr) | |
library(purrr) | |
library(readr) | |
file_txt<- "<Nome_do_arquivo_baixado.txt>" | |
conversa_txt <- readLines(file(file_txt , encoding = "UTF8")) | |
id_linhas_sujas<- |
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(tidyverse) | |
library(data.table) | |
library(geobr) | |
library(cartogram) | |
library(sf) | |
library(colorspace) |
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(tidyverse) | |
#Busca os dados do rreo para o ano de 2021 no RN, relatório "01" (balanço orçamentário) |
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/siconfiBD") | |
library(siconfiBD) | |
siconfiBD::setup_siconfi(project_id = <seu_projeto>) #aqui você coloca o id do seu projeto no Big Query. Vide: https://basedosdados.github.io/mais/access_data_bq/ | |
contas<-siconfiBD::get_distinct_rev_account(year = 1989:2019) | |
#O nome da conta relativa a receita de CFURH varia ao longo dos anos. Dessa forma é itneressante verificar todas os nomes de contas que tenham hídrico na série temporal |
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
#Busca de dados de atendimentos hospitalares | |
#Consumo de todos os dados de internações hospitalares para um determinado ano. | |
# uso da bibiliteca microdatasus | |
#SALDANHA, Raphael de Freitas; BASTOS, Ronaldo Rocha; BARCELLOS, Christovam. Microdatasus: pacote para download e pré-processamento de microdados do Departamento de Informática do SUS (DATASUS). Cad. Saúde Pública, Rio de Janeiro , v. 35, n. 9, e00032419, 2019 . Available from http://ref.scielo.org/dhcq3y. | |
#remotes::install_github("rfsaldanha/microdatasus") | |
estados<- c("AC","AL","AM", "AP", "BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB", "PR","PE","PI","RJ","RS","RN","RO","RR","SC","SP","SE","TO") |
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(siconfiBD) | |
library(geobr) | |
library("basedosdados") | |
library(tidyverse) | |
library(colorspace) | |
siconfiBD::setup_siconfi(project_id = <seu_projeto>) | |
#Busca de dados de população de municípios |
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
unidade_gestao<- 255000 #funasa | |
ano<-2020 | |
#aqui pega todas as combinações de dia e mês. Pode-se alterar a partir da necessidade do usuário | |
dia_do_mes<- str_pad(as.character("1":"31"), side = "left",width=2, pad="0") | |
nome_mes<- str_pad(as.character("1":"12"), side = "left",width=2, pad="0") | |
data_com_erro<- tibble(dia=character(),mes=character(),ano=character()) | |
mapa_completo_dados_abertos<- |
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
#devtools::install_github("tchiluanda/rtn") | |
library(rtn) | |
rtn::get_12_month_accumulated_account_data_by_month(c("despesa total","receita líquida"), | |
month = c(1:12), | |
match_required = FALSE) %>% | |
rtn::plot_rtn_series() |
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
elza<- rtweet::search_tweets("elza", n=18000, include_rts = FALSE ) | |
tidy_elza<- | |
elza %>% | |
unnest_tokens(word, text, token = "tweets", strip_punct = TRUE, strip_url = TRUE) %>% | |
group_by(word) %>% | |
filter(n() > 5) %>% | |
ungroup() %>% | |
select(word) |