Learn R Programming

cardinalR

The cardinalR package provides a collection of functions to generate a large variety of structures in high dimensions.

Installation

You can install the released version of cardinalR from CRAN with:

install.packages("cardinalR") 

The development version from GitHub with:

# install.packages("pak")
pak::pak("JayaniLakshika/cardinalR")

Example

library(cardinalR)
head(mobiusgau, 5)
#> # A tibble: 5 × 4
#>        x1       x2       x3      x4
#>     <dbl>    <dbl>    <dbl>   <dbl>
#> 1  0.517  -0.579   -0.00951 -0.0401
#> 2  0.0142 -0.00841  0.0147   0.0579
#> 3 -0.402   0.506   -0.196   -0.0325
#> 4 -0.218  -0.684    0.0347   0.0497
#> 5  0.225   0.699    0.00575  0.0251

To view the data in high-dimensional space

langevitour(mobiusgau)

Following shows three 2-D projections from the 4-D mobiusgau data.

You can find the high-dimensional view in here.

tSNE (t-distributed Stochastic Neighbor Embedding) and UMAP (Uniform Manifold Approximation and Projection) representations of mobiusgau are shown below. Figures a–c illustrate the t-SNE projections and figures d–f present the corresponding UMAP projections.

About the name

collection of various high-dimensional data structures in R

Copyright

This package is licensed under the MIT license.

Copy Link

Version

Install

install.packages('cardinalR')

Monthly Downloads

199

Version

1.0.6

License

MIT + file LICENSE

Maintainer

Jayani P. G. Lakshika

Last Published

December 18th, 2025

Functions in cardinalR (1.0.6)

gen_nsum

Generates a vector of positive integers whose summation is approximately equal to a target value.
gen_hollowsphere

Generate Hollow Sphere
gen_scurvehole

Generate S-curve Data with a Hole
gen_wavydims2

Generate Random Noise Dimensions With Wavy Pattern
gen_wavydims1

Generate Random Noise Dimensions With Wavy Pattern
gen_sphericalspiral

Generate Spherical Spiral
gen_mobius

Generate a 3-D Mobius
gen_unifsphere

Generate Uniform Sphere
gen_rotation

Generate Rotations
gen_unifcubehole

Generate Cube with Hole
gen_scurve

Generate S-curve Data
gen_orgcurvybranches

Generate data with curvy shaped branches in a initial point
gen_pyrstar

Generate Star Based Pyramid
make_chain_circles

Generate a Chain of Interlocked Circles in High-Dimensional Space
gen_wavydims3

Generate Random Noise Dimensions With Wavy Pattern
gen_pyrrect

Generate Rectangular-based Pyramid
make_gaucircles

Generate Concentric Circles with a Gaussian Cluster in High Dimensions
make_gaucurvycycle

Generate Concentric Curvycycles with a Gaussian Cluster in High Dimensions
gen_linearbranches

Generate data with linear shaped branches
mobiusgau

Mobius clust dataset with a noise dimension
mobiusgau_tsne1

tSNE embedding for mobiusgau dataset which with noise dimensions tSNE parameters set to perplexity: 15.
three_clust_05

Three-Cluster Dataset in 4-D
mobiusgau_umap1

UMAP embedding for mobiusgau dataset which with noise dimensions UMAP parameters set to n-neigbors: 15 and min-dist: 0.1.
mobiusgau_umap2

UMAP embedding for mobiusgau dataset which with noise dimensions UMAP parameters set to n-neigbors: 30 and min-dist: 0.08.
make_twogrid_overlap

Generate Two Overlapping Grid Clusters in High Dimensions
relocate_clusters

Relocate Clusters in High-Dimensional Space
make_twogrid_shift

Generate Two Shifted Grid Clusters in High Dimensions
randomize_rows

Randomize Rows of a Data Frame
gen_helicalspiral

Generate Helical Hyper Spiral
gen_multicluster

Generate Multiple Clusters
make_onegrid

Generate a Single Grid Cluster in High Dimensions
gen_noisedims

Generate Random Noise Dimensions
gen_gridedsphere

Generate Grided Sphere
gen_trefoil3d

Generate 3-D Trefoil Knot Coordinates (Stereographic Projection)
make_chain_curvycycle

Generate a Chain of Interlocked curvycycle in High-Dimensional Space
gen_swissroll

Generate Swiss Roll Data
make_curvygau

Generate Curvy Quadratic and Gaussian Clusters
three_clust_02

Three-Cluster Dataset in 4-D
gen_pyrtri

Generate Triangular Based Pyramid
gen_quadratic

Generate Quadratic
gen_orglinearbranches

Generate data with linear shaped branches in a initial point
gen_trefoil4d

Generate 4-D Trefoil Knot Coordinates
gen_pyrfrac

Generate p-D Triangular Pyramid With Triangular Pyramid shaped holes
gen_unifcube

Generate Cube with uniform points
make_multigau

Generate Multiple Gaussian Clusters
make_mobiusgau

Generate Gaussian cluster with the Mobius Cluster
make_shape_para

Generate Parallel Multi-Shape Clusters
mobiusgau_tsne3

tSNE embedding for mobiusgau dataset which with noise dimensions tSNE parameters set to perplexity: 5.
mobiusgau_tsne2

tSNE embedding for mobiusgau dataset which with noise dimensions tSNE parameters set to perplexity: 30.
three_clust_03

Three-Cluster Dataset in 4-D
three_clust_04

Three-Cluster Dataset in 4-D
make_klink_circles

Generate Multiple Interlocked Circles in High-Dimensional Space
make_klink_curvycycle

Generate Multiple Interlocked curvycycle in High-Dimensional Space
mobiusgau_umap3

UMAP embedding for mobiusgau dataset which with noise dimensions UMAP parameters set to n-neigbors: 5 and min-dist: 0.9.
three_clust_01

Three-Cluster Dataset in 4-D
normalize_data

Generate Normalized data
gen_cubic

Generate Cubic
gen_clustloc

Generate Cluster Locations
gen_circle

Generate Circle in p-d
gen_bkgnoise

Generate Background Noise Data
gen_curvycycle

Generate Curvy Cell Cycle in p-d
gen_crescent

Generate Crescent
gen_curvybranches

Generate data with curvy shaped branches
gen_conicspiral

Generate Conical Spiral
gen_clusteredspheres

Generate Small Spheres Within a Big Sphere
gen_cone

Generate Blunted Cone
gen_expbranches

Generate data with exponential shaped branches
gen_hemisphere

Generate Hemisphere
gen_curvycylinder

Generate Curvy Cylinder
gen_gaussian

Generate Multivariate Gaussian Cloud
gen_longlinear

Generate Long Linear Data
gen_hole

Remove points within a spherical hole in the middle
gen_gridcube

Generate Cube with grid points
gen_nonlinear

Generate Nonlinear Hyperbola
gen_nproduct

Generates a vector of positive integers whose product is approximately equal to a target value.