R/is.withinclass.R

Defines functions is.withinclass

Documented in is.withinclass

is.withinclass <-
function(x)
# is.withinclass()  -  test if x is within-class ( assumes is specific)
{
  colons <- which(strsplit(x,"")[[1]] == ":") 
  if(length(colons) == 0 ) {  # nonspecific case
    wclass <- T
  }
  else {  # specific case
    class1 <- substr(x,colons[1]+1,colons[2]-1)
    class2 <- substr(x,colons[2]+1,colons[3]-1)
    if ( class1 == class2) {
      wclass <- T
    } 
    else {
      wclass <- F
    }
  }
  return(wclass)
}

Try the dmm package in your browser

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

dmm documentation built on July 26, 2023, 5:23 p.m.