R/bitspec.R

bit.spectrum <- function(fplist) {
  if (class(fplist) != 'list') stop("Must provide a list of fingerprint objects")
  if (any(unlist(lapply(fplist, class)) != 'fingerprint'))
    stop("Must provide a list of fingerprint objects");
  nbit <- length(fplist[[1]])
  spec <- numeric(nbit)
  for (i in 1:length(fplist)) {
    bits <- fplist[[i]]@bits
    spec[bits] <- spec[bits]+1
  }
  spec / length(fplist)
}

Try the fingerprint package in your browser

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

fingerprint documentation built on May 2, 2019, 4:10 p.m.