private static String[] rVersionChoices(JsArray<RVersionSpec> rVersions) {
      // do we need to disambiguate identical version numbers
      boolean disambiguate = RVersionSpec.hasDuplicates(rVersions);

      // build list of choices
      ArrayList<String> choices = new ArrayList<String>();

      // always include "default" lable
      choices.add(USE_DEFAULT_VERSION);

      for (int i = 0; i < rVersions.length(); i++) {
        RVersionSpec version = rVersions.get(i);
        String choice = "R version " + version.getVersion();
        if (disambiguate) choice = choice + " (" + version.getRHome() + ")";
        choices.add(choice);
      }

      return choices.toArray(new String[0]);
    }