Learn R Programming

glmmBUGS (version 2.4.2)

rongelapUTM: Rongelap island data

Description

A SpatialPointsDataFrame containing the Rongelap data, in a UTM projection.

Usage

data("rongelapUTM")
data("rongelapResult")

Arguments

Details

These coordinates were obtained by translating and rotating the original Rongelap data until all the coordinates fit into the Rongelap border given by www.gadm.org. So they are not exact.

Examples

Run this code
# NOT RUN {
data("rongelapUTM")
if(require("sp", quietly=TRUE)){
	plot(rongelapUTM)
}

# }
# NOT RUN {
rongelapBorderLL = raster::getData("GADM", 
country="MHL",level=0) 
library("rgdal")
rongelapBorderUTM = spTransform(rongelapBorderLL, 
	CRS(proj4string(rongelapUTM)))
plot(rongelapBorderUTM, add=TRUE)
# }
# NOT RUN {
rongelapUTM$logOffset = log(rongelapUTM$time)
rongelapUTM$site = seq(1, length(rongelapUTM$time)) 
  
forBugs = glmmBUGS(
formula=count + logOffset ~ 1, family="poisson",
    data=rongelapUTM@data, effects="site", 
    spatial=rongelapUTM,
    priors=list(phisite="dgamma(100,1)")
    )

startingValues = forBugs$startingValues
startingValues$phi=list(site = 100)

source("getInits.R")

# }
# NOT RUN {
rongelapResult = bugs(forBugs$ragged, getInits, 
  parameters.to.save = names(getInits()),
    model.file="model.bug", n.chain=2, n.iter=20, n.burnin=4, n.thin=2,
      program="winbugs", debug=TRUE,
      working.directory=getwd())
rongelapParams = restoreParams(rongelapResult, forBugs$ragged)
# }
# NOT RUN {
data("rongelapResult")
rongelapParams = restoreParams(rongelapResult)


checkChain(rongelapParams)

rongelapSummary=summaryChain(rongelapParams)
# }

Run the code above in your browser using DataLab