Learn R Programming

beadplexr (version 0.5.0)

density_cut: Density cut.

Description

Cut data based on density.

Usage

density_cut(.x, .k, .lower = 0.1, .upper = 2, .step = 0.1)

Value

A factor, see base::cut()

Arguments

.x

A numeric vector.

.k

Numeric giving the number of expected clusters.

.lower, .upper

The interval for possible value of adjust.

.step

A numeric giving the increment to adjust. Sometimes low values are needed to find a proper adjust value.

Examples

Run this code
set.seed(1234)
.x <- c(rnorm(200, 0, 1), rnorm(200, 0.8, 1))
.k <-  2
density_cut(.x, .k)

Run the code above in your browser using DataLab