## The Matérn function can be used in Euclidian spaces of any dimension:
set.seed(123)
randpts <- matrix(rnorm(20),nrow=5)
distMatrix <- as.matrix(proxy::dist(randpts))
Matern.corr(distMatrix,nu=2)
Run the code above in your browser using DataLab