-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.R
57 lines (48 loc) · 2.24 KB
/
global.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# shinyHome
# Real Estate Analytics and Forecasting
# John James
# Date: June 27, 2016
# global.R
###############################################################################
# LOAD PACKAGES AND MODULES #
###############################################################################
require(rCharts)
options(RCHART_LIB = 'polycharts')
library(datasets)
library(dplyr)
library(forecast)
library(ggplot2)
library(plotly)
library(plyr)
library(rCharts)
library(reshape)
library(shiny)
library(shinydashboard)
library(TTR)
library(xlsx)
################################################################################
# GLOBAL VARIABLES #
################################################################################
#Default Values
dflt <- list(state = "", county = "", city = "", zip = "", model = "ARIMA",
split = as.integer(2014), maxValue = as.integer(1000000), stringsAsFactors = FALSE)
###############################################################################
# LOAD DATA #
###############################################################################
#Delete the following line before deploying this to shiny.io
home <- getwd()
setwd("processedData")
currentZip = read.csv("currentZip.csv", header = TRUE, stringsAsFactors = FALSE)
currentCity = read.csv("currentCity.csv", header = TRUE, stringsAsFactors = FALSE)
currentCounty = read.csv("currentCounty.csv", header = TRUE, stringsAsFactors = FALSE)
currentState = read.csv("currentState.csv", header = TRUE, stringsAsFactors = FALSE)
hviAllZip = read.csv("hviAllZip.csv", header = TRUE, stringsAsFactors = FALSE)
hviAllCity = read.csv("hviAllCity.csv", header = TRUE, stringsAsFactors = FALSE)
hviAllCounty = read.csv("hviAllCounty.csv", header = TRUE, stringsAsFactors = FALSE)
hviAllState = read.csv("hviAllState.csv", header = TRUE, stringsAsFactors = FALSE)
# Read model data
modelData <- read.xlsx("models.xlsx", sheetIndex = 1, header = TRUE)
# File containing unique geo codes, state,city, zip
geo <- read.csv("geo.csv", header = TRUE)
#Set directory back to project home directory
setwd(home)