Learn R Programming

clugenr (version 1.0.4)

clupoints_n_1_template: Create points from their projections on a cluster-supporting line

Description

Generate points from their n-dimensional projections on a cluster-supporting line, placing each point on a hyperplane orthogonal to that line and centered at the point's projection. The function specified in dist_fn is used to perform the actual placement.

Usage

clupoints_n_1_template(projs, lat_disp, clu_dir, dist_fn)

Value

Generated points (p np x n matrix).

Arguments

projs

Point projections on the cluster-supporting line (p np x n matrix).

lat_disp

Dispersion of points from their projection.

clu_dir

Direction of the cluster-supporting line (unit vector).

dist_fn

Function to place points on a second line, orthogonal to the first.

Details

This function is used internally by clupoints_n_1 and may be useful for constructing user-defined final point placement strategies for the point_dist_fn parameter of the main clugen function.

Examples

Run this code
set.seed(123)
ctr <- c(0, 0)
dir <- c(1, 0)
pdist <- c(-0.5, -0.2, 0.1, 0.3)
proj <- points_on_line(ctr, dir, pdist)
clupoints_n_1_template(proj, 0, dir, function(p, l) stats::runif(p))

Run the code above in your browser using DataLab