Unique


Contents

Description

This function takes a vector vs and returns the unique values. You can decide whether to sort the unique output values and how to reduce the duplicated values.

Syntax

 vector<string> Unique(vector<string> vs[, int Sort, int Occurrence])

Parameters

vs

is the vector in which unique values are searched

Sort

[optional] integer that specifies whether to sort the output unique values:

Occurrence

[optional] integer that specifies how to reduce the duplicated values.

Return

Returns a vector of the unique values in vs.

Example

newbook;
col(A) = {1,10,15,8,2};
col(B) = unique(col(A));