0

I have a list that looks like this, it is a measure of dispersion for each sample.

         1          2          3          4          5 
0.11829384 0.24987017 0.08082147 0.13355495 0.12933790 

To further analyze this I need it to be a distance structure, the -vegan- package need it as a 'dist' object.

I found some solutions that applies to matrices > dist, but how could I change this current data into a dist object?

I am using the FD package, at the manual I found,

Still, one potential advantage of FDis over Rao’s Q is that in the unweighted case (i.e. with presence-absence data), it opens possibilities for formal statistical tests for differences in FD between two or more communities through a distance-based test for homogeneity of multivariate dispersions (Anderson 2006); see betadisper for more details

I wanted to use vegan betadisper function to test if there are differences among different regions (I provided this using element "region" with column "region" too)

functional <- FD(trait, comun)
mod <- betadisper(functional$FDis, region$region)

using gowdis or fdisp from FD didn't work too.

distancias <-  gowdis(rasgo)
mod <- betadisper(distancias, region$region)
dispersion <- fdisp(distancias, presence)
mod <- betadisper(dispersion, region$region)

I tried this but I need a list object. I thought I could pass those results to betadisper.

Andrés Parada
  • 319
  • 7
  • 21
  • This does not look like a list, but rather a vector. Distances are *between* sampling units, but your narrative indicates that your numbers are for single SUs ("dispersion for each sample"). Such things cannot be transformed to distances. There cannot be a distance structure with 5 elements: 4 SUs have 6 distance among them, and 3 SUs have 3. With this background I would say that you cannot turn your vector to a `dist` object. – Jari Oksanen Mar 30 '17 at 06:40
  • I modified the post to include more information, thanks for your help. – Andrés Parada Mar 30 '17 at 13:26
  • This was just the head of the object, I have as many distances as sites/communities -27- although as you said it seems like a vector instead of the usual dis object returned via _vegdist_. – Andrés Parada Mar 30 '17 at 13:33

1 Answers1

1

You cannot do this: FD::fdisp() does not return dissimilarities. It returns a list of three elements: the dispersions FDis for each sampling unit (SU), and the results of the eigen decomposition of input dissimilarities (eig for eigenvalues, vectors for orthonormal eigenvectors). The FDis values are summarized for each original SU, but there is no information on the differences among SUs. The eigen decomposition can be used to reconstruct the original input dissimilarities (your distancias from FD::gowdis()), but you can directly use the input dissimilarities. Function FD::gowdis() returns a regular "dist" structure that you can directly use in vegan::betadisper() if that gives you a meaningful analysis. For this, your grouping variable must be based on the same units as your distancias. In typical application of fdisp, the units are species (taxa), but it seems you want to get analysis for communities/sites/whatever. This will not be possible with these tools.

Jari Oksanen
  • 3,287
  • 1
  • 11
  • 15