SHARE
TWEET

alunos_universidade_rs_2018

matheus__serpa Sep 21st, 2019 (edited) 120 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. library(dplyr)
  2. library(readr)
  3. library(tidyr)
  4.  
  5. setwd("/scratch/msserpa/microdados_ed_superior_2018/dados")
  6.  
  7. dfIES   <- read_delim("DM_IES.CSV", delim="|") %>%  as.data.frame
  8. dfCurso <- read_delim("DM_CURSO.CSV", delim="|") %>% filter(TP_ORGANIZACAO_ACADEMICA == 1) %>% filter(CO_MUNICIPIO == 4314902) %>% filter(!is.na(QT_INSCRITO_TOTAL)) %>% filter(TP_MODALIDADE_ENSINO == 1) %>% filter(TP_NIVEL_ACADEMICO == 1) %>% as.data.frame
  9. dfAux   <- read_delim("TB_AUX_CINE_BRASIL.CSV", delim="|") %>% as.data.frame
  10.  
  11. dfCurso <- dfCurso %>% left_join(dfAux, by = c("CO_CINE_ROTULO"))
  12. dfCurso <- dfCurso %>% left_join(dfIES, by = c("CO_IES"))
  13.  
  14. df <- dfCurso
  15.  
  16. df <- df %>% group_by(CO_CINE_AREA_GERAL, NO_CINE_AREA_GERAL, NO_IES) %>% summarize(total=sum(QT_INSCRITO_TOTAL)) %>% as.data.frame()
  17.  
  18. df
  19.  
  20. write_csv(df, "saida.csv")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top