Description Usage Arguments Details Value Examples
Generate uniform random points on sphere.
1 2 
n 
Number of points. Can be a vector in which case 
region 
Region (of class 
giveup 
Number of attempts in the rejection method after which the algorithm should stop trying to generate new points. 
warn 
Logical. Whether to issue a warning if 'n“ is very large. See Details. 
... 
Arguments passed on to

nsim 
Number of simulated realisations to be generated. 
drop 
Logical. If 
ex 
Optional. A point pattern to use as the example. If 
This function generates n
independent random points, uniformly
distributed in the region region
on the sphere.
The algorithm depends on the type of region, as follows:
If region
is a box in longitude and latitude coordinates ("s2lonlatbox"
)
then n
independent random points, uniformly distributed in the box, are
generated by assigning uniform random values to their lon,lat coordinates
using the appropriate acos
transform for the latitude coordinates.
If region
is a polygon or cap, the algorithm uses the rejection method.
It finds a s2lonlatbox
enclosing the region, generates points in this box,
and tests whether they fall in the desired region. It gives up when
giveup * n
tests have been performed without yielding n
successes.
If warn = TRUE
, then a warning will be issued if n
is very large. The
threshold is [spatstat.options("huge.npoints")](spatstat::spatstat.options)
.
This warning has no consequences, but it helps to trap a number of common errors.
A point pattern on the sphere (an object of class "s2pp") if
nsim = 1
and drop = TRUE
, or a list of point patterns otherwise.
1 2 3 4 5 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.