Hi Jackson,

you could use the complete.cases function to remove the pairs with NA
before run the distance function as bellow.

# CorDistance function does not handle NAs
x <- cbind(as.vector(s[[1]]), as.vector(s2[[1]]))
select.rows <- complete.cases(x)
CorDistance(x[select.rows, ] )

Cheers!
-- 
Frederico Faleiro
Postdoctoral Researcher in the INCT-EECBio (https://www.eecbio.ufg.br/)
Department of Ecology | Institute of Biological Science | Federal
University of Goiás | Brazil
RG: https://www.researchgate.net/profile/Frederico_Faleiro
CV: http://lattes.cnpq.br/4926404840659003

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to