Learn R Programming

charm (version 2.18.0)

maxDensity: Find the mode of a density function

Description

Calculate a density function and find the max point

Usage

maxDensity(x, n.pts = 2^14, minPoints=30)

Arguments

x
a data vector
n.pts
Number of points to use in density estimation
minPoints
Minimum number of data points to accept

Value

a numeric value

Details

This function finds the maximum of a density function. It is identical to the (unexported) max.density function in affy except that it returns an NA if the number of data points provided is less than minPoints

Examples

Run this code
x <- rnorm(1000)
maxDensity(x)

Run the code above in your browser using DataLab