Im a begginer using R, and Im trying to apply a permutation process (statistical test) for two matrix comparison in order to assess if there is a real relation between spatial association and functional traits of forest tree species.
My first matrix is formed by indices of spatial interactions positive (+) and negative (-) between species. Positive interactions (+) were assigned with the value of 3 and negative interactions (-) with the value of 1. The second matrix, include the mean euclidean distance of functional traits between species.
Theoretically, what I want to do, is to randomize or permute the trait matrix (incidence matrix) along the spatial matrix, without broken (or better said-retaining) the spatial structure of association among species. One permutation for positive ones (+) and other permutation for negative ones (-).
Can anybody help me to structure a script in R to test this previous relationship? I just have the two csv species x species matrix files!.