R/get.unique.R

Defines functions get.unique

get.unique <-
function(x, digits = 4L)
{
  check <- is.matrix(x)
  if(check)
    n <- nrow(x)
  else
    n <- length(x)
  if(mode(digits) == "numeric")
    xr <- round(x, digits = digits)
  else
    xr <- x
  iind <- !duplicated(xr)
  if(check) {
    xu <- xr[iind,]
    lu <- nrow(xu)
  } else {
    xu <- xr[iind]
    lu <- length(xu)
  }
  get <- getuit(xr, xu, n, lu)
  index <- get$ind

  return(list(x = xr, xu = xu, ind = index, iind = iind))
}

Try the R2BayesX package in your browser

Any scripts or data that you put into this service are public.

R2BayesX documentation built on Oct. 20, 2023, 9:11 a.m.