This function generates a dataset consisting of two overlapping
grid-like clusters in a 2D space, with optional noise dimensions
added to reach higher-dimensional spaces. The overlap is controlled
by scaling factors for the grids.
Usage
make_twogrid_overlap(n = c(500, 500), p = 4)
Arguments
- n
A numeric vector of length 2 specifying the number of points
in each grid cluster.
- p
An integer specifying the total number of dimensions.
Must be greater than or equal to 2. If p > 2
, additional
noise dimensions are appended.
Value
A tibble with n[1] + n[2]
rows and p + 1
columns:
x1, ..., xp
— coordinates of the generated points.
cluster
— cluster membership label.
Examples
# Generate two overlapping grid clusters in 4-D
df <- make_twogrid_overlap()
#> ✔ Data generation completed successfully!!!
#> ✔ Data generation completed successfully!!!
#> ✔ Multiple clusters generation completed successfully!!!
#> ✔ 2 noise dimensions have been generated successfully!!!