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 May 29, 2024, 11:14 a.m.