Learn R Programming

cardinalR (version 1.0.6)

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

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.

Arguments

n

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

Examples

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

Run the code above in your browser using DataLab