make_twogrid_overlap: Generate Two Overlapping Grid Clusters in High Dimensions

View source: R/odd_shapes.R

make_twogrid_overlapR Documentation

Generate Two Overlapping Grid Clusters in High Dimensions

Description

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))

Arguments

n

A numeric vector of length 2 specifying the number of points in each grid cluster.

Value

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

  • x1,x2, x3, x4 — coordinates of the generated points.

  • cluster — cluster membership label.

Examples

# Generate two overlapping grid clusters in 4-D
df <- make_twogrid_overlap()


cardinalR documentation built on Dec. 18, 2025, 9:08 a.m.