make_onegrid: Generate a Single Grid Cluster in High Dimensions

View source: R/odd_shapes.R

make_onegridR Documentation

Generate a Single Grid Cluster in High Dimensions

Description

This function generates a dataset consisting of one grid-like cluster (a structured cube grid) in 2D, with optional Gaussian noise dimensions added to extend the dataset into higher dimensions.

Usage

make_onegrid(n = 500, p = 4)

Arguments

n

Integer, the number of points in the grid cluster. Must be positive. Default is 500.

p

Integer, the dimensionality of the embedding space. Must be at least 2. Default is 4.

Value

A tibble containing the generated dataset with columns:

  • x1, x2, ..., xp — coordinates of the data points.

  • cluster — cluster assignment (always 1 for the grid).

Examples

# Default: 500 points, 4D space (grid in 2D + 2 noise dimensions)
onegrid <- make_onegrid()



cardinalR documentation built on Aug. 21, 2025, 5:27 p.m.