
// SKIP-THIS-TEST
// this should work but we do not assume everyone has R installed

import io;
import string;
import R;

global const string template =
"""
  x <- %i
  a <- x+100
  cat("the answer is: ", a, "\\n")
""";

main
{
  code = sprintf(template, 4);
  s = R(code, "toString(a)");
  printf("the answer was: %i", s);
}


// SKIP-THIS-TEST
// this should work but we do not assume everyone has R installed

import io;
import string;
import R;

global const string template =
"""
  x <- %i
  a <- x+100
  cat("the answer is: ", a, "\\n")
  a
""";

main
{
  code = sprintf(template, 4);
  s = R(code);
  printf("the answer was: %i", s);
}

--- 
+++ 
@@ -11,12 +11,11 @@
   x <- %i
   a <- x+100
   cat("the answer is: ", a, "\\n")
-  a
 """;
 
 main
 {
   code = sprintf(template, 4);
-  s = R(code);
+  s = R(code, "toString(a)");
   printf("the answer was: %i", s);
 }
Update for latest R calling sequence
