fn format_factor_labels(labels: &[String]) -> String
Format factor labels as R-style output with line indices.