Hi! I am working with climatic data of several plant species. I have created a hypervolume and obtained its centroid, and now I am trying to calculate the Euclidean distance between it and another centroid. I have been trying using the pointDistance command like this, but get an error:
pointDistance(unscaledCentroid_Celtisaustralis, hoh.clim,lonlat=FALSE, allpairs=FALSE)
Error in .pointsToMatrix(p1) : Wrong length for a vector, should be 2
I have checked the data in both points but I can't see anything that could explain this error.
hoh.clim
A tibble: 1 × 6
species point_ID mean_temperature mean_precipitation seasonality_temperature seasonality_precipitation
1 Uni Hohenheim centroid 9.04 70.8 666. 0.476
unscaledCentroid_Celtisaustralis
mean_temperature mean_precipitation seasonality_temperature seasonality_precipitation
12.6879987 85.7007952 0.6085140 0.7323761
Does anyone know what I am doing wrong? Thank you.