Skip to content

Spatial cluster analysis

6 messages · ah3881, Mathieu Rajerison, José Miguel Barrios +1 more

#
Hello all

I am fairly new to the world of R and am working somewhere where no one uses
it much yet...
I want to run a spatial cluster analysis on a load of species distributions
(binary ASCII or PNG maps) to look for possible "biotic" zones, i.e.
regional species assemblies. I have tried downloading some of the "cluster"
type packages but have as yet have not managed to get anything to run.
If I upload the file of folders into R, could anyone advise me on the best
package, and a possible script that I can use to run the spatial cluster?
Thanks so much!

Alice 

--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Spatial-cluster-analysis-tp7149074p7149074.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
1 day later
#
Thanks for that, it looks great for the raw spatial data!
The thing is I have used the raw spatial data to produce a species
distribution projection for each species (using Maxent), then reclassified
each to give a binary presence absence map (which is currently a PNG, but
could be redone as an ASCII file), so I am mainly working with binary maps
rather than the points-and it is these distributions I want to run cluster
analysis on-so I can see the segregation of different community assemblies
in space. 

--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Spatial-cluster-analysis-tp7149074p7153834.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
1 day later
#
I think that the correct answer to this question is "use the raster and
the dismo package". In fact, dismo has the possibility of "fitting"
Maxent models directly from R.

In any case, with raster package you can easily import ASC files (I
suppose one file for each species), join them in an stack object and
depending on the size of your maps (i.e. number of pixels) and your
favourite classification approach (e.g. hierarchical vs. non
hierarchical) select the appropriate functions/packages. For example,
package vegan has function vegedist that is very appropriate for
community data. You can use it to compute a distance matrix (based on
the species data) between the pixels of your map an then submit this
matrix to hclust to compute a classificatory tree. You can cut this tree
(with cutree) at the desired number of communities or dissimilarity and
create a new layer in your raster stack with the "number" of cluster
to which each pixel has been assigned that can eassily ploted as a
"community map"
If the number of pixels is large you can consider using function clara in
package cluster or a combination of clara for a subsample (i.e. training
data set) plus a nearest neughbour classifier (e.g. function knn1)

HTH,

Marcelino

Con fecha 5/1/2012, "Jos? Miguel Barrios" <jmbarriosg at gmail.com>
escribi?: