get.peaks {cyphid}R Documentation

A function to identify peaks within a dataset.

Description

A subroutine called by functions within the cyphid package. get.peaks is originally from the package msProcess version 1.0.5. The package was archived on 2012-09-21 and is unvailable as a dependency for cyphid. The arichived package and original code can be obtained from http://cran.r-project.org/src/contrib/Archive/msProcess/

Usage

get.peaks(x, span = 40)

Arguments

x
span

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (x, span = 40) 
  {
    z <- embed(rev(as.vector(x)), dim = span)
    z <- z[rev(seq(nrow(z))), ]
    s <- span%/%2
    v <- max.col(z, ties.method = "first") == 1 + s
    z <- c(rep(FALSE, s), v)
    ans <- c(z[1:(length(z) - s)], rep(FALSE, span - 1))
    nx <- NCOL(x)
    if (nx > 1) 
      matrix(ans, ncol = nx)
    else ans
  }

[Package cyphid version 1.1 Index]