R/dup.r

Defines functions dup

Documented in dup

############ S-function: dup  ############

# For determined whether a value
# in a vector is duplicated

# Last changed: 07 JUL 2001

dup <- function(dat)
{
   dat <- match(dat,unique(dat))
   id <- order(dat)
   look <- c(F, ifelse(diff(sort(dat))==0,T,F))
   dat[id] <- look
     
   return(as.logical(dat))
}

########### End of dup #############

Try the SemiPar package in your browser

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

SemiPar documentation built on April 16, 2018, 5:05 p.m.