rddensityUnique function

Internal function.

Internal function.

Find unique elements and their frequencies in a numeric vector. This function has a similar performance as the built-in R function unique.

rddensityUnique(x)

Arguments

  • x: Numeric vector, already sorted in ascending order.

Returns

  • unique: A vector containing unique elements in x.

  • freq: The frequency of each element in x.

  • index: The last occurrence of each element in x.

  • Maintainer: Xinwei Ma
  • License: GPL-2
  • Last published: 2024-10-06

Useful links