genepeak: Estimating modal distribution

Description Usage Arguments See Also Examples

Description

Estimating the number of peak corresponding to non-zero value from probability density distribution

Usage

1
genepeak(x, width = 1)

Arguments

x

A vector

width

The numeric width which is used to estimate probability density distribution function

See Also

peak

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
x=c(rnorm(50,4,0.5),rep(0,length=20))
genepeak(x)
genepeak(x,width=2)

## The function is currently defined as
function (x, width = 1) 
{
    if (length(x[x != 0]) > 1) {
        pp = density(x[x != 0], width = width)
        Hpeak = peak(pp)
        return(dim(Hpeak)[1])
    }
    else {
        return(0)
    }
  }

Fang0828/SCMarker documentation built on May 13, 2019, 12:51 p.m.