Visualize College Scoreboard Data

This site displays data on academic institutions over time (see https://collegescorecard.ed.gov/data for the College Scorecard, a project of the US Dept of Education).

show with app
library(shiny)
require(mosaic)
trellis.par.set(theme=theme.mosaic())
mtheme = theme.mosaic()
load("PROCESSED2015-09-20.Rda")
# dssmall <- ds
lwdval <- 2
mtheme$superpose.line$lwd <- lwdval + 1
spanval <- 0.4
cat("got to here...\n", file=stderr())

shinyServer(function(input, output) {
  output$plot <- renderPlot({
    
    cat("got even further...\n", file=stderr())
    schools <- input$schools
    cat("length of schools is ", length(schools), "\n", file=stderr())
    cat(input$schools, "\n", file=stderr())
    dssmall <- ds %>% filter(INSTNM %in% schools)
    variable <- input$variable
    lwdval <- 3
    value <- input$additions
    if (value=="line") {
      typeval = c("p", "l")
    } else if (value=="smoother") {
      typeval = c("p", "smooth") 
    } 
    if (variable=="PCIP05") {
      xyplot(PCIP05 ~ year, group=INSTNM, type=typeval, span=spanval, auto.key=list(columns=2, lines=TRUE, points=TRUE), 
             lwd=lwdval, ylab="Proportion of graduates in Area Studies", par.settings = mtheme, data=dssmall)
    } else if (variable=="PCIP11") {
      xyplot(PCIP11 ~ year, group=INSTNM, type=typeval, span=spanval, auto.key=list(columns=2, lines=TRUE, points=TRUE), 
             lwd=lwdval, ylab="Proportion of graduates in Computer Science", par.settings = mtheme, data=dssmall)
    } else if (variable=="PCIP26") {
      xyplot(PCIP26 ~ year, group=INSTNM, type=typeval, span=spanval, auto.key=list(columns=2, lines=TRUE, points=TRUE), 
             lwd=lwdval, ylab="Proportion of graduates in Biological Science", par.settings = mtheme, data=dssmall)
    } else if (variable=="PCIP27") {
      xyplot(PCIP27 ~ year, group=INSTNM, type=typeval, span=spanval, auto.key=list(columns=2, lines=TRUE, points=TRUE), 
             lwd=lwdval, ylab="Proportion of graduates in Math and Statistics", par.settings = mtheme, data=dssmall)
    } else if (variable=="PCIP42") {
      xyplot(PCIP42 ~ year, group=INSTNM, type=typeval, span=spanval, auto.key=list(columns=2, lines=TRUE, points=TRUE), 
             lwd=lwdval, ylab="Proportion of graduates in Psychology", par.settings = mtheme, data=dssmall)
    } else if (variable=="PCIP45") {
      xyplot(PCIP45 ~ year, group=INSTNM, type=typeval, span=spanval, auto.key=list(columns=2, lines=TRUE, points=TRUE), 
             lwd=lwdval, ylab="Proportion of graduates in Social Science", par.settings = mtheme, data=dssmall)
    } else if (variable=="PCIP50") {
      xyplot(PCIP50 ~ year, group=INSTNM, type=typeval, span=spanval, auto.key=list(columns=2, lines=TRUE, points=TRUE), 
             lwd=lwdval, ylab="Proportion of graduates in Performing and Visual Arts", par.settings = mtheme, data=dssmall)
    } else if (variable=="PCIP54") {
      xyplot(PCIP54 ~ year, group=INSTNM, type=typeval, span=spanval, auto.key=list(columns=2, lines=TRUE, points=TRUE), 
             lwd=lwdval, ylab="Proportion of graduates in History", par.settings = mtheme, data=dssmall)
    } else {
      xyplot(runif(100) ~ runif(100))  # shouldn't get here...
    }
  })
})

library(shiny)

load("PROCESSED2015-09-20.Rda")


shinyUI(fluidPage(
  titlePanel("Visualize College Scoreboard Data"),
  p('This site displays data on academic institutions over time (see https://collegescorecard.ed.gov/data for the College Scorecard, a project of the US Dept of Education).'),
  radioButtons("variable", "Which variable?",
    c("Biological Studies" = "PCIP26", 
      "Computer Science" = "PCIP11", "History" = "PCIP54",
      "Math and Stats" = "PCIP27", "Performing and Visual Arts" = "PCIP50",
      "Psychology" = "PCIP42", "Social Science" = "PCIP45"
      ), selected="PCIP27"),
  radioButtons("additions", "Include line or smoother?",
               c("smoother"="smoother",
                 "line"="line")), 
  checkboxGroupInput('schools', 'Colleges to display:',
    sort(unique(ds$INSTNM)), selected = "Amherst College"), 
  plotOutput("plot")
))