I have a dataframe with each row being a different site (51 sites), and each column being mean values of a different continuous environmental variable (19 variables).
I am trying to calculate a measure of environmental similarity/dissimilarity by using a distance calculation between sites.
I would like to calculate either a standardized Euclidean distance or Mahalanobis distance.
I have managed to get them to work with both the distance function in the package ecodist, and the
dist.quant() function in the package ade4 in [R].
AusEnvDist <- distance(AusEnvNum, method="euclidean", sprange=NULL)
However my outputs are the same regardless of how the dataframe is organized (i.e., sites being in rows or columns) – I get an output matrix of $19\times19$ instead of $51\times51$ – i.e., it's not calculating the distance between sites, but between variables. Any ideas on how to fix this? Or a better method for getting a singular "environmental" value for each site?