R/pedigree.trim.R

Defines functions pedigree.trim

Documented in pedigree.trim

# Automatically generated from all.nw using noweb

pedigree.trim <- function(removeID, ped){
## trim subjects from a pedigree who match the removeID 
## trim relation matrix as well

  if(!("pedigree" %in% class(ped)))
    stop("Must be a pegigree object.\n")

  rmidx <- match(removeID, ped$id)
  if(length(rmidx)>0) {
    pedtrimmed <- ped[-rmidx]
    return(pedtrimmed)
  } else {
  return(ped)
  }
}

Try the kinship2 package in your browser

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

kinship2 documentation built on Oct. 5, 2022, 5:05 p.m.