make_twogrid_overlap | R Documentation |
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.
make_twogrid_overlap(n = c(500, 500), p = 4)
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 |
A tibble with n[1] + n[2]
rows and p + 1
columns:
x1, ..., xp
— coordinates of the generated points.
cluster
— cluster membership label.
# Generate two overlapping grid clusters in 4-D
df <- make_twogrid_overlap()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.