plot-api / jetbrains.letsPlot / as_discrete

as_discrete

fun as_discrete(variable: String, label: String? = null): MappingMeta

Marks a numeric variable as categorical. The plot will use a discrete scale for the aesthetic mapping. It is similar to the factor() function from R but works differently - there is no data transformation.

Parameters

variable - string The name of the variable

label - string The name of the scale - used as the axis label or the legend title