
kseq
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.kseq(from = NULL, to = NULL, f = 0.05, ...)
NULL
.NULL
.0.05
.## Generate numbers of bins.
n <- 10000
Sturges <- as.integer(1 + log2(n)) ## Minimum v follows the Sturges rule.
Log10 <- as.integer(10 * log10(n)) ## Maximum v follows the Log10 rule.
RootN <- as.integer(2 * n^0.5) ## Maximum v follows the RootN rule.
K <- kseq(from = Sturges, to = Log10, f = 0.05)
K
K <- kseq(from = Sturges, to = RootN, f = 0.03)
K
Run the code above in your browser using DataLab