R/make_dup.R

Defines functions make_dup

make_dup <- function(respm)
  {
    
  patts <- apply(respm,1,function(x) paste(x,collapse=""))
  ndpat <- !duplicated(patts)
  seppat <- patts[ndpat]
  posvec <- vector(mode="integer",length = length(patts))
  
  for(i in 1:length(seppat))
    {
      posvec[patts %in% seppat[i]] <- i   
    }
  return(list(posvec=posvec,ndpat=ndpat))
  }  

Try the PP package in your browser

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

PP documentation built on May 27, 2021, 5:07 p.m.