runif.circ | R Documentation |
An object of class "SpatPatterns"
.
Generates n
2D points uniformly in the circle with center=cent
and radius=rad
using the rejection
sampling approach (i.e., the function generates points in the smallest square containing the circle, keeping
only the points inside the circle until n points are generated).
The defaults for cent=c(0,0)
and rad=1
.
runif.circ(n, cent = c(0, 0), rad = 1)
n |
A positive integer representing the number of points to be generated uniformly in the circle |
cent |
A 2D point representing the center of the circle, with default= |
rad |
A positive real number representing the radius of the circle. |
A list
with the elements
pat.type |
|
type |
The type of the point pattern |
parameters |
center of the circle, |
lab |
The class labels of the generated points, |
init.cases |
The initial points, |
gen.points |
The output set of generated points uniform in the circle. |
ref.points |
The input set of reference points, it is |
desc.pat |
Description of the point pattern |
mtitle |
The |
num.points |
The number of generated points. |
xlimit,ylimit |
The possible ranges of the x- and y-coordinates of the generated points |
Elvan Ceyhan
runif
n<-20 #or try sample(1:20,1); #try also 10, 100, or 1000; r<-.1; #try also r<-.3 or .5 cent<-c(1,2) #data generation Xdat<-runif.circ(n,cent,r) #generated data Xdat summary(Xdat) plot(Xdat,asp=1) plot(Xdat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.