getNumeric function

List<String> getNumeric(
  1. WidgetRef ref
)

Return a list of numeric variables that are not ignored.

Implementation

List<String> getNumeric(WidgetRef ref) {
  // The typesProvider lists the types for the different variables which we need
  // to know for parsing the R scripts.

  Map<String, Type> roles = ref.read(typesProvider);

  // Watching stdout to get variables that are Ignored.

  String stdout = ref.read(stdoutProvider);

  List<String> largeFactors = extractLargeFactors(stdout);

  List<String> result = [];

  roles.forEach((key, value) {
    if (value == Type.numeric &&
        !largeFactors.contains(key) &&
        ref.read(rolesProvider.notifier).state[key] != Role.ignore) {
      result.add(key);
    }
  });

  return result;
}