Skip to content

Instantly share code, notes, and snippets.

library(mgcv)
library(raster)
library(magrittr)
library(sp)
# Generate a dummy probability surface using Swaziland as an example
swz_elev <- raster::getData('alt', country="SWZ")
swz_prob <- swz_elev / cellStats(swz_elev, max)
# Generate some random points to act as sampling sites
library(raster)
library(RandomFields)
library(R2OpenBUGS)
library(coda)
library(R2jags)
library(mvtnorm)
# Compare JAGS manual method to spatial.exp in BUGS
# simulate data
@HughSt
HughSt / server.R
Last active August 29, 2015 14:07
library(maptools)
library(RColorBrewer)
ShehiaShp<-readShapeSpatial("Data/ZnzPolyIncWGS1984.shp",proj4string=CRS("+proj=longlat"))
# Import case numbers by Shehia using different travel assumptions
Shehia_Inc_Trav<-read.csv("Data/Shehia_Inc_Travel.csv")
# Generate cats for colors
cols <- brewer.pal(10, "RdBu")[10:1]
@HughSt
HughSt / ui.R
Created October 22, 2014 10:28
shinyUI(fluidPage(
titlePanel("Malaria incidence Zanzibar"),
sidebarLayout(
sidebarPanel(
selectInput("season",
label = "Choose season",
choices = c("Both","Wet","Dry")),