set.seed(123)
#a distance matrix
coords = matrix(runif(10), ncol=2)
distMat = rdist(coords)
#compute covariance matrix, but only over the upper triangle
upperCov = ExponentialUpper(distMat, range=.1)
print(distMat)
print(upperCov)
Run the code above in your browser using DataLab