crossdist.sph | R Documentation |
Computes the distances between pairs of points on the sphere, taken from two different datasets
crossdistsph(X, Y, rad = 1)
X, Y |
Locations of points. Objects of class |
rad |
The radius of the sphere, default value 1. Only required when
neither |
Given two datasets X
and Y
(representing two point
patterns on the same (subset of a) sphere) crossdist.sph
computes
the great circle distance from each point in the first dataset to each
point in the second dataset, and returns a matrix containing these
distances.
If X
is an object of class sp2
or
sp3
, then its radius is used in this calculation. If
X
is a matrix, and Y
is an object of class
sp2
or sp3
, then its radius is used in
this calculation. If both X
and Y
are objects of class
sp2
or sp3
, they must have the same radius
or an error will be generated.
A matrix whose [i,j]
entry is the distance from the i
-th
point in the first dataset to the j
-th point in the second dataset.
This function is the analogue for point processes on the sphere of the
function crossdist
in spatstat, which is the
corresponding function for point processes in R^2. Hence
elements of the code for crossdist.sph
and help page have been taken
from crossdist
with the permission of
A. J. Baddeley. This enables the code to be highly efficient and give
corresponding output to, and for the information on this help page to
be consistent with that for the function crossdist
.
It is hoped that this will minimise or remove any confusion for users
of both spatstat and spherstat.
Tom Lawrence <email: tjlawrence@bigpond.com>
nncrosssph
(nearest neighbour distances between two
samples), nndistsph
(nearest neighbour distances),
gcdist
(great circle distance between two points),
bdist.sphwin
(boundary distances), crossdist
sph <- sphwin(type="sphere") rps1 <- rpoispp.sphwin(win=sph, lambda=1) rps2 <- rpoispp.sphwin(win=sph, lambda=1) crossdistsph(X=rps1, Y=rps2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.