powered by
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.
discretize.dens(data, graph=F, title="Density-approxmative Discretization", rename.level=F, return.all=T, cluster=F, seed=NULL)
a vector containing the data that may be discretized
a boolean value, if TRUE, the density and the determined binning are plotted
a title for the plot
a boolean value, if TRUE, factor levels are replaced by integers 1:n
a boolean value, if FALSE, only the discretized data are returned.
a boolean value, if data is a cluster variable and may already be discrete or not
a random seed number
the discretized data
the factor levels
the x and y coordinates of the determined peaks
# NOT RUN { testdata = c(rnorm(100,-3,1), rnorm(100,3,1)) d<-discretize.dens(testdata, graph=TRUE) summary(d$discretized) # }
Run the code above in your browser using DataLab