alunosUFCGAnon <- read.csv("~/Documents/alunosUFCGAnon.csv")
registros <- alunosUFCGAnon
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
alunos <- transform(registros,media_credito=Creditos*Media_Disciplina)
alunos <- summarise(group_by(alunos,Matricula,Nome_Curso,Creditos_Curso,Periodo_Ingresso,Campus,Centro),total_media_credito = sum(media_credito,na.rm=TRUE),total_creditos=sum(Creditos,na.rm=TRUE))
alunos <- transform(alunos,cre=total_media_credito/total_creditos)
alunos_formados <- filter(alunos,total_creditos > Creditos_Curso-15)
alunos_formados <- select(alunos_formados,Nome_Curso,Periodo_Ingresso,cre)
alunos_formados <- alunos_formados[order(-alunos_formados$cre),]
alunos_formados[c(1:10),]
## Nome_Curso Periodo_Ingresso cre
## 2079 CIÊNCIAS ECONÔMICAS - M 2005.1 9.656614
## 4562 DIREITO - M 2005.1 9.471983
## 1803 CIÊNCIAS ECONÔMICAS - M 2009.1 9.428856
## 329 HISTÓRIA (LIC) - N 2007.2 9.380000
## 1833 ADMINISTRAÇÃO - D 2010.1 9.344279
## 594 ENGENHARIA CIVIL - D 2002.1 9.323950
## 3034 CIÊNCIAS BIOLÓGICAS (LIC) - D 2010.1 9.317617
## 898 DIREITO - M 2005.1 9.314655
## 2076 DIREITO - M 2006.1 9.303814
## 4610 DIREITO - M 2008.1 9.295339
alunos_formados <- alunos_formados[order(alunos_formados$cre),]
alunos_formados[c(1:10),]
## Nome_Curso Periodo_Ingresso cre
## 73 ENGENHARIA ELÉTRICA 2004.2 0.8674074
## 1933 CIÊNCIAS ECONÔMICAS - M 2002.1 0.9922488
## 2135 ENGENHARIA CIVIL - D 2002.1 1.2996795
## 3808 ENGENHARIA ELÉTRICA 2004.1 1.3640167
## 66 ENGENHARIA CIVIL - D 2002.1 1.4073930
## 4013 ENGENHARIA CIVIL - D 2002.1 1.4878706
## 3701 CIÊNCIA DA COMPUTAÇÃO - D 2004.2 1.7980392
## 511 CIÊNCIA DA COMPUTAÇÃO - D 2002.2 2.0386364
## 3999 ENGENHARIA DE MINAS - D 2005.1 2.2742373
## 489 ENGENHARIA ELÉTRICA 2003.2 2.2845638