-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.R
21 lines (16 loc) · 871 Bytes
/
server.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
library(shiny)
library(rjson)
## Load the relevant data
addResourcePath("data", "data")
load("data/clean_sotc.RData")
corr.dat <- read.csv("data/CEcor.csv")
## Bind together the data in JSON format
data <- list(data_json = toJSON(list(all = unname(split(clean.all.city.merge, 1:nrow(clean.all.city.merge))),
`2008` = unname(split(clean.2008.city.merge, 1:nrow(clean.2008.city.merge))),
`2009` = unname(split(clean.2009.city.merge, 1:nrow(clean.2009.city.merge))),
`2010` = unname(split(clean.2010.city.merge, 1:nrow(clean.2010.city.merge))))),
data_json_corr = toJSON(unname(split(corr.dat, 1:nrow(corr.dat)))))
shinyServer(function(input, output) {
## Output a reactive version of this data
output$d3io <- reactive(data)
})