simdesign_discunif {simdata}R Documentation

Uniform disc sampling design specification

Description

Provides 2-dimensional points, spread uniformly over disc, or partial disc segment (i.e. a circle, or ring, or ring segment). Useful for e.g. building up clustering exercises.

Usage

simdesign_discunif(
  r_min = 0,
  r_max = 1,
  angle_min = 0,
  angle_max = 2 * pi,
  name = "Uniform circle simulation design",
  ...
)

Arguments

r_min

Minimum radius of points.

r_max

Maximum radius of points.

angle_min

Minimum angle of points (between 0 and 2pi).

angle_max

Maximum angle of points (between 0 and 2pi).

name

Character, optional name of the simulation design.

...

Further arguments are passed to the simdesign constructor.

Details

The distribution of points on a disk depends on the radius - the farther out, the more area the points need to cover. Thus, simply sampling two uniform values for radius and angle will not work. See references.

Value

List object with class attribute "simdesign_discunif" (S3 class), inheriting from "simdesign". It contains the same entries as a simdesign object but in addition the following entries:

r_min
r_max
angle_min
angle_max

References

https://mathworld.wolfram.com/DiskPointPicking.html

Examples

disc_sampler <- simdesign_discunif()
plot(simulate_data(disc_sampler, 1000, seed = 19))

ring_segment_sampler <- simdesign_discunif(r_min = 0.5, angle_min = 0.5 * pi)
plot(simulate_data(ring_segment_sampler, 1000, seed = 19))

circle_sampler <- simdesign_discunif(r_min = 1)
plot(simulate_data(circle_sampler, 1000, seed = 19))


[Package simdata version 0.4.0 Index]