RLUR: A dashboard for developing and applying Land Use Regression models for air pollution exposure estimation
Developed on R.3.3.2 "Sincere Pumpkin Patch" and RStudio 1.0.136
See the help options in the software for more info on LUR and model development
-Click 'Clone or Download' then 'Download zip' button in Github (the green one above right)
-Save the folder somewhere and unzip
-Test data is in the 'testdata' folder
-In R. This needs doing only once
-Run the following code to download/install the third-party packages needed
packages <- c("shinydashboard", "shiny", "car", "DT", "caret", "maptools", "rgdal", "raster", "sp", "rgeos", "leaflet", "shinyBS", "RColorBrewer")
if (length(setdiff(packages, rownames(installed.packages()))) > 0) {
install.packages(setdiff(packages, rownames(installed.packages())))
}
-(A) From local files:
-Open either the downloaded 'server.r' or 'ui.r' file from (1) in RStudio
-Use the drop-down next to 'run app' to make sure 'run external' is checked
-Click 'Run App'
-(B) Directly from GitHub:
-With this method you do not need to download the files as in step (1)
-Just run the following code in RStudio
require(shiny)
runGitHub("RLUR", "dwmorley")
There is a dependency issue in the Mac version of the R PROJ4 package resulting in the error:
rgdal::checkCRSArgs: no proj_defs.dat in PROJ.4 shared files
The solution is to recompile packages from source
A) Open a new terminal window to run the commands below (i.e. Not in R, a new command line prompt)
B) Install homebrew package manager (http://brew.sh/)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
C) Re-compile OSGEO
brew tap osgeo/osgeo4mac
D) Update PROJ4
brew install proj
E) Restart any R sessions