Learn R Programming

DatabionicSwarm (version 2.0.0)

UniquePoints: Unique Points

Description

return only the unique points in Datapoints

Usage

UniquePoints(Datapoints, Eps=1e-10)

Value

List with

Unique

[1:k,1:d] Datapoints points without duplicate points

IsDuplicate

[1:n,1:n] matrix,for i!=j IsDuplicate[i,j]== 1 if Datapoints[i,] == Datapoints[j,] IsDuplicate[i,i]==0

UniqueInd

[1:k] index vector such that Unique == Datapoints[UniqueInd,], it has k non-consecutive numbers or labels, each label defines a row number within Datapoints[1:n,1:d] of a unique data point

Uniq2DatapointsInd

[1:n] index vector. It has k unique index numbers representing the arbitrary labels. Each labels is mapped uniquely to a point in Unique. Logically in a way such that Datapoints == Unique[Uniq2DatapointsInd,] (will not work directly in R this way)

Arguments

Datapoints

[1:n,1:d] matrix of Datapoints points of dimension d, the points are in the rows

Eps

Optional,scalar above zero that defines minimum non-identical euclidean distance between two points

Author

Michael Thrun

Details

Euclidean distance is computed and used within. Setting Eps to a very small number results in the identification of unique data points. Setting epsilon to a higher number results in the definition of mesh points within an d-dimensional R-ball graph.

Examples

Run this code
Datapoints2D=rbind(c(1,2),c(1,2),c(1,3),c(3,1))
V=UniquePoints(Datapoints2D)

Run the code above in your browser using DataLab