Sequence of Bins or Nearest Neighbours Generation

Share:

Description

Returns (invisibly) a vector containing numbers of bins v for the histogram and the Parzen window or numbers of nearest neighbours k for the k-nearest neighbour.

Usage

1
kseq(from = NULL, to = NULL, f = 0.05, ...)

Arguments

from

starting value of the sequence. The default value is NULL.

to

end value of the sequence. The default value is NULL.

f

number specifying the fraction by which the bins or nearest neighbours should be separated 0.0 < f < 1.0. The default value is 0.05.

...

currently not used.

Author(s)

Marko Nagode

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Generate numbers of bins.

n <- 10000

Sturges <- as.integer(1 + log2(n)) # Minimum v follows Sturges rule.
Log10 <- as.integer(10 * log10(n)) # Maximum v follows Log10 rule.
RootN <- as.integer(2 * n^0.5) # Maximum v follows RootN rule.

K <- kseq(from = Sturges, to = Log10, f = 0.05)

K

K <- kseq(from = Sturges, to = RootN, f = 0.03)

K

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.