fields-wrapper.Rd
These functions are simple wrappers to nearest.dist
to be used in fields
.
spam_rdist( x1, x2, delta = 1)
spam_rdist.earth( x1, x2, delta = 1, miles=TRUE, R=NULL)
Matrix of first set of locations where each row gives the coordinates of a particular point.
Matrix of second set of locations where each row gives the coordinates of a particular point.
only distances smaller than delta
are recorded,
see Details.
For great circle distance: If true distances are in statute miles if false distances in kilometers.
Radius to use for sphere to find spherical distances. If NULL
the radius is either in miles or kilometers depending on the
values of the miles argument. If R=1
then distances are of
course in radians.
A spam
object containing the distances spanned between
zero and delta
. The sparse matrix may contain many zeros
(e.g., collocated data). However, to calculate covariances, these zeros
are essential.
These functions are wrappers to rdist
and
rdist.earth
in fields
. They are used
to simplify the use of sparse matrices in functions like mKrig
.
For great circle distance, the matrices x1
and x2
contain the degrees longitudes in the first and the degrees latitudes
in the second column. delta
is in degrees. Hence to restrict
to distances smaller than delta.km
, one has to specify
delta=delta.km*360/(6378.388*2*pi)
.