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(lubridate) | |
library(scales) | |
library(tidyverse) | |
# regulariza o formato da data do tweet, corrige para fuso certo | |
d$created_at <- as.POSIXct(strptime(d$created_at, "%Y-%m-%d %H:%M:%S")) | |
d$created_at <- d$created_at - hours(3) | |
d$dia <- as.POSIXct(strptime(d$created_at, "%Y-%m-%d")) | |
# cria coluna com minuto arredondado |
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(clipr) | |
# BRASIL - GERAL | |
# média de distanciamento social | |
bid %>% | |
filter(data> '2020-03-15' & region_type == "country" & dia_semana != "domingo") %>% | |
summarise(media = mean((ratio_20 - 1) * 100), mediana = median((ratio_20 - 1) * 100)) | |
# distanciamento social por dia da semana |
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(glue) | |
library(stringr) | |
library(deflateBR) | |
library(lubridate) | |
# 2017 e 2018 usam .CSV com caixa alta | |
# 2019 e 2019 usam .csv com minúsculas | |
# Não há dados para março de 2019 | |
url <- "http://repositorio.dados.gov.br/segrt/QUARENTENA_{mes}{ano}.CSV" |
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
# -*- coding: utf-8 | |
# Abraji (https://www.abraji.org.br) | |
# Reinaldo Chaves ([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/ | |
import requests | |
import pandas as pd | |
# Link da requisição principal |
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) | |
emplacamentos <- read_delim("https://docs.google.com/spreadsheets/d/e/2PACX-1vRY5Wc7j9qAEbStZioZBGEQB_o4S_eyJnVca8oP7gGTafvg8ZwDdZWYkzAx_455KOs3Q9uZQ9qSFIZ3/pub?gid=0&single=true&output=csv", delim = ",", locale = locale(grouping_mark = ".")) | |
emplacamentos$Ano <- as.Date(paste0(emplacamentos$Ano, "-01-01")) | |
marcas <- read_delim("https://docs.google.com/spreadsheets/d/e/2PACX-1vRY5Wc7j9qAEbStZioZBGEQB_o4S_eyJnVca8oP7gGTafvg8ZwDdZWYkzAx_455KOs3Q9uZQ9qSFIZ3/pub?gid=794101571&single=true&output=csv", delim = ",", locale = locale(grouping_mark = ".")) | |
marcas$Ano <- as.Date(paste0(marcas$Ano, "-01-01")) |
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(newsatlasbr) | |
library(clipr) | |
atlas_signin(email = "[email protected]", password = "senhatokenaberto") | |
dados <- newsatlasbr::organizations_state(uf = "all") | |
desertos <- newsatlasbr::news_deserts() |
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
screen_name | semana | med | var_semana | |
---|---|---|---|---|
cirogomes | 2021-11-29 | 1289939.42857143 | 0.21663569941901 | |
cirogomes | 2021-12-06 | 1292566.57142857 | 0.203664048012886 | |
cirogomes | 2021-12-13 | 1295949 | 0.261683123035605 | |
cirogomes | 2021-12-20 | 1298984.42857143 | 0.23422438471179 | |
cirogomes | 2021-12-27 | 1301667.71428571 | 0.20656796611771 | |
cirogomes | 2022-01-03 | 1304274.71428571 | 0.200281528948465 | |
cirogomes | 2022-01-10 | 1307455.28571429 | 0.243857478316079 | |
cirogomes | 2022-01-17 | 1310957.42857143 | 0.26785947446224 | |
cirogomes | 2022-01-24 | 1316434.71428571 | 0.417808053481528 |
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(lubridate) | |
library(clipr) | |
ptbr <- read.csv("dados_pt.csv", header = T) | |
ptbr$lang <- "português" | |
eng <- read.csv("dados_eng.csv", header = T) | |
eng$lang <- "inglês" |
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
suppressMessages(library(odbc)) | |
suppressMessages(library(DBI)) | |
suppressMessages(library(RPostgreSQL)) | |
suppressMessages(library(tidyverse)) | |
suppressMessages(library(tidytext)) | |
suppressMessages(library(wordcloud2)) | |
suppressMessages(library(lubridate)) | |
library(config) | |
library(ngram) |