stringFrequency

fun ReportBuilder.stringFrequency(freq: StringFrequency, caption: String? = null, showPlot: Boolean = true, proportions: Boolean = false)(source)

Appends a self-contained section that reports the frequency distribution and an optional frequency bar plot for a StringFrequency tabulation.

Produces (inside a section titled caption or freq.name):

  1. A ksl.utilities.io.report.ast.ReportNode.Paragraph summarising total observations, distinct string count, and — when non-zero — the count of observations that fell outside the limit set ("other" count).

  2. A DataTable ("Frequency Table") with columns: String | Count | Cum Count | % | Cum %

  3. A ksl.utilities.io.report.ast.ReportNode.PlotNode for the frequency bar chart (omitted when showPlot is false).

No ksl.utilities.io.report.ast.ReportNode.StatPropertyTable is produced because string categories carry no numeric statistics.

Usage:

val doc = report("Classification Results") {
stringFrequency(classificationFrequency)
}

Parameters

freq

the string frequency tabulation to report

caption

optional section title; defaults to freq.name

showPlot

when true (default) a bar chart is appended after the frequency table. Set to false to omit the plot.

proportions

when true the bar chart y-axis shows proportions; when false (default) it shows counts. Has no effect when showPlot is false.