discretize.dens {GroupBN} | R Documentation |
discretize.dens
Description
density approximative discretization. Significant peaks in the density are determined and used as starting points for k-means based discretization. If only one peak is present, distribution quartiles are used for binning.
Usage
discretize.dens(data, graph=F, title="Density-approxmative Discretization",
rename.level=F, return.all=T, cluster=F, seed=NULL)
Arguments
data |
a vector containing the data that may be discretized |
graph |
a boolean value, if TRUE, the density and the determined binning are plotted |
title |
a title for the plot |
rename.level |
a boolean value, if TRUE, factor levels are replaced by integers 1:n |
return.all |
a boolean value, if FALSE, only the discretized data are returned. |
cluster |
a boolean value, if data is a cluster variable and may already be discrete or not |
seed |
a random seed number |
Value
discretized |
the discretized data |
levels |
the factor levels |
optima |
the x and y coordinates of the determined peaks |
Author(s)
Ann-Kristin Becker
Examples
testdata = c(rnorm(100,-3,1), rnorm(100,3,1))
d<-discretize.dens(testdata, graph=TRUE)
summary(d$discretized)
[Package GroupBN version 1.2.0 Index]