rExtractCluster function

String rExtractCluster(
  1. String log,
  2. WidgetRef ref
)

Implementation

String rExtractCluster(String log, WidgetRef ref) {
  // Extract from the R log those lines of output from the cluster.

  String extract = _basicTemplate(log, ref);

  // Now clean up the output for an annotated presentation of the output.

  // Given there are 10 clusters, for the cluster centers add a separating blank
  // line after each group of centers, for the case where the variables are more
  // than fit on one line.

  // THIS IS WRONG - 10 is a parameter so it only works if the default is not
  // changed. It also interferes elsewhere? (gjw 20250514)

  // final pattern = RegExp(r'\n10.*?(?=\n)');

  // extract = extract.replaceAllMapped(pattern, (match) {
  //   return '${match.group(0)}\n';
  // });

  return extract;
}