top of page
Search

Creating a moving window average with two distance matrices

  • mojodu54
  • Nov 23, 2024
  • 1 min read

I wrote a short function in R that combines two distance matrices (for example a floristic dissimilarity matrix and a geographical distance matrix).


The function takes the elements from the first matrix and averages all the distances according to either:

  • a number of neighbouring cells

  • an absolute distance between neighbouring cells


The result is a vector of averaged values. This can then be visualized to see how dissimilarity changes with spatial scales.


Like this





You can check it out on my github.

 
 
 

Recent Posts

See All
Combining dissimilarity matrices

This idea comes from a great paper I read about using floristics, function and pyhlogeny to delimit biomes in Brazil ( Cardoso et al....

 
 
 

Comments


©2021 by Mathew Rees. 

bottom of page