Skip to content

Instantly share code, notes, and snippets.

View sillasgonzaga's full-sized avatar

Sillas Teixeira Gonzaga sillasgonzaga

View GitHub Profile
@sillasgonzaga
sillasgonzaga / mapa_movimento_migratorio_universitario.R
Last active July 9, 2018 01:37
Post reprodutível e consertado do post sobre o Censo da Educação Superior
library(data.table)
library(readxl)
library(tidyverse)
library(stringi)
library(magrittr)
library(sf)
library(geosphere)
#### Importacao dos dados ####
# arquivos originais extraidos do endereco abaixo
---
title: "Aula 4.1 - Modelagem"
output:
html_notebook:
css: custom.css
number_sections: yes
toc: yes
toc_float: true
---
### 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)
nrbf <- function(X, Y, X_test = X, k = ncol(X), gamma = 1.0, seed = 123, plot = TRUE){
library(corpcor)
library(neuralnet)
set.seed(seed)
#### Definição dos argumentos:
# X: Matriz de input
# Y: Matriz de output
# k: número de centros (polos)
# gamma: parametro de aprendizado
library(tidyverse)
library(igraph)
library(ggraph)
library(abjutils)
df <- read_rds("data/socios_cvm.rds")
glimpse(df)
df_clean <- df %>%
filter(tipo == "02") %>%
# https://github.com/Selbosh/user2017
library(tidyverse)
library(rvest)
library(xml2)
library(ggraph)
library(igraph)
# https://rud.is/dl/r-bloggers-feedly-streams.rds
df <- read_rds("r-bloggers-feedly-streams.rds")
library(tidyverse)
library(fs)
dir_path <- "projetos/site-master/content/blog/"
dir_info(dir_posts, recursive = TRUE) %>%
head() %>%
knitr::kable()
rmd_or_r_file_paths_tbl <- dir_info(dir_path, recursive = T) %>%
@sillasgonzaga
sillasgonzaga / aula3_notebook.Rmd
Last active April 28, 2018 12:01
Aula 03 - Curso de Ciência de Dados com R
---
title: "Aula 3: Gráficos no R"
output:
html_notebook:
css: custom.css
number_sections: yes
toc: yes
toc_float: true
---
# devtools::install_github("timelyportfolio/sunburstR")
library(tidyverse)
library(sunburstR)
sequences <- read.csv(
system.file("examples/visit-sequences.csv",package="sunburstR")
,header = FALSE
,stringsAsFactors = FALSE
)[1:200,]
library(tabulizer)
library(tidyverse)
arquivo <- "C:/Users/sillas.gonzaga/Downloads/gsa.pdf"
tab <- tabulizer::extract_tables(arquivo, encoding = "UTF-8", method = "lattice")
map(tab,dim)
# extrair tabelas com 8 colunas