lab9R - Areal analysis in R Load Splancs Package Reading...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Areal analysis in R Load Splancs Package Reading the rushes.dat dataset rushes<-read.table(rushes.txt) rushes$x<-rushes[,1] rushes$y<-rushes[,2] plot(as.points(rushes)) poly1<- matrix(c(0,0, 0,1 ,1,1, 1,0),byrow=T, ncol=2) #defines domain EXERCISE 1: Simulating a Homogeneous Poisson process #Function: #csr(poly,npoints) #Arguments: # poly: A polygon data set. # npoints: The number of points to generate. #Details: # 'csr' generates points randomly in the bounding box of 'poly,' #In R: poly1<- matrix(c(0,0, 0,1 ,1,1, 1,0),byrow=T, ncol=2) #defines domain csr(poly1, 100)->csrexample #generates 100 points in the area determined by poly1 plot(csrexample) ##################################################################### EXERCISE 2: POISSON CLUSTER PROCESS # This R code simulates a Poisson cluster process, conditioned on # n=100 points, with 5 parents, h(.) unifrom on a circle of radius .1 # npts <- 100 #no. of offsprings #nparents <- 20 #no. of parents nparents <- 5 #no. of parents #maxrad <- .10 #radius maxrad <- .010 #radius maxdia <- 2*maxrad nkids <- matrix(0,nparents,1) spatpts <- matrix(0,npts,2) parxpts <- matrix(runif(nparents),nparents,1) parypts <- matrix(runif(nparents),nparents,1)...
View Full Document

This note was uploaded on 08/01/2008 for the course ST 733 taught by Professor Fuentes during the Summer '08 term at N.C. State.

Page1 / 4

lab9R - Areal analysis in R Load Splancs Package Reading...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online