Skip to content

Instantly share code, notes, and snippets.

Sillas Teixeira Gonzaga sillasgonzaga

Block or report user

Report or block sillasgonzaga

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View spotify_scraper.R
library(spotifyr)
library(tidyverse)
Sys.setenv(SPOTIFY_CLIENT_ID = '')
Sys.setenv(SPOTIFY_CLIENT_SECRET = '')
xml <- read_html("https://developer.spotify.com/documentation/general/guides/scopes/")
scopes <- xml %>% html_nodes("code") %>% html_text() %>% unique()
auth <- get_spotify_authorization_code(scope = scopes)
View limpar_dados_metro_sp.R
# baixar dados
library(tidyverse)
library(foreign)
library(readxl)
library(janitor)
library(fuzzyjoin)
# download.file("http://www.metro.sp.gov.br/pesquisa-od/arquivos/Pesquisa-Origem-Destino-2017-Banco-Dados.zip",
# destfile = "od.zip")
#
View collect_imdb_data.R
library(tidyverse)
library(jsonlite)
library(UpSetR)
#### imdb data ####
# Fonte: https://www.imdb.com/interfaces/
imdb_title_akas <- read_delim("data/imdb/title.akas.tsv.gz",
delim = "\t",
na = c("", "\\N"))
View scraping_zap.R
library(rvest)
library(stringr)
url_zap <- 'https://www.zapimoveis.com.br/aluguel/apartamentos/sp+sao-paulo/?__zt=ad:a'
xml2::read_html("https://www.zapimoveis.com.br/")
html_obj <- httr::GET(url_zap) %>%
read_html()
View mapas_datasus
# http://r-br.2285057.n4.nabble.com/R-br-Ler-MAP-no-R-Shapefile-td4661880.html
# http://www2.datasus.gov.br/DATASUS/tabwin/DocTabWin.htm
# http://datasus.saude.gov.br/versao-3
# http://www2.datasus.gov.br/DATASUS/tabwin/rx/Importa_mapa.htm
# http://datasus.saude.gov.br/cadastros-nacionais/294-download-mapas-tabwin
read.map = function(filename){
zz=file(filename,"rb")
#
@sillasgonzaga
sillasgonzaga / api_quotas_fundos.R
Last active Aug 19, 2019
API para baixar quotas de fundos
View api_quotas_fundos.R
library(httr)
library(magrittr)
library(xml2)
library(rvest)
url_raw <- "http://dados.cvm.gov.br/dados/FI/DOC/INF_DIARIO/DADOS/"
output_file <- "fundos/api/informe_diario.csv"
csv_links <- httr::GET(url_raw) %>%
httr::content("text") %>%
View valuation_proseek.R
# adaptacao da planilha de valuation da proseek
library(dplyr)
library(purrr)
library(magrittr)
#### párametros unicos
taxa_impostos_indiretos <- 14.65/100
margem_estimada <- 19.78/100
taxa_ir_base <- 8/100
@sillasgonzaga
sillasgonzaga / mapa_movimento_migratorio_universitario.R
Last active Jul 9, 2018
Post reprodutível e consertado do post sobre o Censo da Educação Superior
View mapa_movimento_migratorio_universitario.R
library(data.table)
library(readxl)
library(tidyverse)
library(stringi)
library(magrittr)
library(sf)
library(geosphere)
#### Importacao dos dados ####
# arquivos originais extraidos do endereco abaixo
View Aula_4.1_modelagem.Rmd
---
title: "Aula 4.1 - Modelagem"
output:
html_notebook:
css: custom.css
number_sections: yes
toc: yes
toc_float: true
---
View sna_modulo02_adj_matrix.R
### Módulo 2
### Matriz de adjacência
library(igraph)
library(igraphdata)
# exemplo de matriz de adjacencia
data("karate")
karate
# transformar grafo em matriz de adjacencia
igraph::as_adjacency_matrix(karate)
You can’t perform that action at this time.