R/calc.numcats.R

calc.numcats <-
function(edta) {
  ssnos <- unique(edta$SjNo)
  np <- length(ssnos)
  numcat <- array(NA,np)
  for (i in 1:np) {
    es1 <- edta[edta$SjNo == ssnos[i],]
    numcat[i] <- length(unique(es1$CategoryNo))
  }
  numcat
}

Try the freesortphi package in your browser

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

freesortphi documentation built on May 2, 2019, 5:54 p.m.