-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanalysis.r
30 lines (22 loc) · 811 Bytes
/
analysis.r
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
enrollment <- read.csv("Enrollment2003-2016.csv")
library(magrittr)
library(dplyr)
library(ggplot2)
library(shiny)
enrollment %>%
filter(Grade != 'PKEEE') %>%
group_by(County, year) %>%
summarise(EnrollmentSum=sum(Enrollment)) %>%
mutate(maxEnrollment=max(EnrollmentSum),enrollmentRatio=EnrollmentSum/maxEnrollment) -> temp
sp<-ggplot(temp, aes(x=year, y=enrollmentRatio, color=County)) + geom_line()
sp
enrollment %>%
filter(County == "Chittenden County") %>%
filter(Grade != 'PKEEE') %>%
group_by(SupervisoryUnion, year) %>%
summarise(EnrollmentSum=sum(Enrollment)) %>%
mutate(maxEnrollment=max(EnrollmentSum),enrollmentRatio=EnrollmentSum/maxEnrollment) -> temp
sp<-ggplot(temp, aes(x=year, y=enrollmentRatio, color=SupervisoryUnion)) + geom_line()
sp
temp
runApp("Shiny App")