Skip to content
Prev 6761 / 29559 Next

John Snow's cholera data/map: a more sp-ish way?

Hi Michael,

I tried to play with the streets and transform them into a spatialLines by:

l1=split(Snow.streets[,3:4],as.factor(Snow.streets[,1]))
Ll1=lapply(l1,Line)
Lsl1=Lines(Ll1,paste("Street",1:length(Ll1)))
Snow.streets.sp=SpatialLines(list(Lsl1))
plot(Snow.streets.sp)

For the pumps:

spp=SpatialPoints(Snow.pumps[,3:4])
Snow.pumps.sp=SpatialPointsDataFrame(spp,Snow.pumps[,1:2])
plot(Snow.pumps.sp,add=T,col='red',pch=20)

For the deaths:

Snow.death.sp = SpatialPoints(Snow.deaths[,2:3])
plot(Snow.death.sp,add= T, col ='blue')

For polygons, I think that it should be a little bit more complicated.. 
but I have no time today to have a look at it.

Is it correct Roger?

Cheers.
Roger Bivand wrote: