Learn R Programming

cardinalR (version 1.0.6)

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

Value

A tibble containing the generated dataset with columns:

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

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

Arguments

n

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

Examples

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


Run the code above in your browser using DataLab