R365: Day 41 – {AMOEBA}

Hand still busted. I ran across {AMOEBA} while looking for spatial analysis packages. {AMOEBA} is a package with a single function (!), AMOEBA(). AMOEBA stands for A Multidirectional Optimum Ecotope-Based Algorithm, which lets you calculate spatial clusters and has an awesome name. Using their base example, we can plot crime across Columbus, OH.

Rplot08

#looking at the AMOEBA help example
###########################################
########## Example of boundaries ##########
###########################################
require(AMOEBA)
### Columbus OH spatial analysis data set (spdep package)
data(columbus)
require(maptools)
map<-readShapePoly(system.file('etc/shapes/columbus.shp',package='spdep')[1])
### Application of AMOEBA
res<-AMOEBA(columbus$CRIME,col.gal.nb,1,1)
### Plot
color<-rev(rainbow(length(table(res)),start=0,end=2/6))
plot(map,col=color[as.factor(res)])
title('Clustering of crimes at Columbus (OH)')
names<-c('\nLow','\nMedium','\nHigh')
require(plotrix)
color.legend(map@bbox[1,1],map@bbox[2,1]-0.2,map@bbox[1,2],map@bbox[2,1]-0.4,names,color,align='rb')

Or % houses without plumbing

Rplot11

 

or housing value

Rplot12

 

i dont know why they didnt just build AMOEBA into {SPDEP}, the mother package, but its still cool.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s