Defines functions seqhasmiss

Documented in seqhasmiss

seqhasmiss <- function(seqdata){
  if (!is.stslist(seqdata)){
    msg.stop("seqdata must be a stslist object!" )
  misscode <- c(attr(seqdata,"nr"),attr(seqdata,"void"))
  nrcode <- attr(seqdata,"nr")
  voidcode <- attr(seqdata,"void")
  has.miss <- apply(seqdata,1,function(x) any(x %in% misscode))
  has.nr <- apply(seqdata,1,function(x) any(x %in% nrcode))
  has.void <- apply(seqdata,1,function(x) any(x %in% voidcode))
  cat("There are ",sum(has.miss)," sequences with missings\n", sum(has.nr),"have nr's,", sum(has.void), " have voids")

Try the TraMineR package in your browser

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

TraMineR documentation built on May 29, 2024, 5 a.m.