Skip to contents

This function generates two grid-shaped clusters in a 2D space, where one grid is shifted relative to the other. Optionally, additional noise dimensions can be added to embed the structure in a higher-dimensional space.

Usage

make_twogrid_shift(n = c(500, 500), p = 4)

Arguments

n

A numeric vector of length 2 specifying the number of points in each cluster. Default is c(500, 500).

p

An integer specifying the total number of dimensions for the output dataset. Must be at least 2. If p > 2, additional noise dimensions will be added. Default is 4.

Value

A tibble with n[1] + n[2] rows and p + 1 columns:

  • x1, x2, ..., xp: Numeric coordinates of the points.

  • cluster: Cluster membership label (factor with 2 levels).

Examples

# Generate 2 shifted grid clusters in 4-D
make_twogrid_shift <- make_twogrid_shift()
#>  Data generation completed successfully!!!
#>  Data generation completed successfully!!!
#>  Multiple clusters generation completed successfully!!!
#>  2 noise dimensions have been generated successfully!!!