rank(x, na.last = T)
For the rank of a matrix see svd, qr or chol.
# create sample objects diffgeom <- testscores[,1] complex <- testscores[,2]rank(diffgeom, na.last="") # cause error if missing values are present
# Spearman's rank correlation between two sets of testscores cor(rank(diffgeom), rank(complex))