The best way to find out how a package or function does something is to look at the source code. This is one of the awesome things about open source projects, you can do this.
try typing varcov.spatial
or searching through the unpacked package tar ball for the function definition
To calculate the covariance (which is dependant on the distance between points), you need to calculate
- the distance between your points (you really only need the lower triangle, as it will be symmetric
- The value of the covariance function at each distance
- form the full symmetric variance covariance matrix from these calculated covariances.
The covariance functions are defined in ?cov.spatial
. You can call cov.spatial
to calculate these in R
(exactly what geoR::varcov.spatial
does)