I now have one failing case and three passing cases...
For the failing case, start test.clj in a Calva Babashka REPL. This is how I was testing...
clj꞉test꞉>
; Evaluating file: test.clj
{:exit 1, :out "", :err "Error in print(tx_sex_m) : object 'tx_sex_m' not found\nExecution halted\n"}
This is the issue I was reporting
Without bb this is what to expect:
$ Rscript adjcox.R
[1] 0
Here are the passing cases: From the bb terminal repl
$ bb
...
user=> (babashka.process/sh ["ls"])
{:proc #object[java.lang.ProcessImpl 0x25c0c982 "Process[pid=21366, exitValue=0]"], :exit 0, :in #object[java.lang.ProcessImpl$ProcessPipeOutputStream 0xb048e81 "java.lang.ProcessImpl$ProcessPipeOutputStream@b048e81"], :out "adjcox.R\nadjcox.Rout\nfoo.txt\nparams.csv\n", :err "", :prev nil, :cmd ["ls"]}
user=> (babashka.process/sh ["Rscript" "adjcox.R"])
{:proc #object[java.lang.ProcessImpl 0x9d1d8c3 "Process[pid=21750, exitValue=0]"], :exit 0, :in #object[java.lang.ProcessImpl$ProcessPipeOutputStream 0x185eca3d "java.lang.ProcessImpl$ProcessPipeOutputStream@185eca3d"], :out "[1] 0\n", :err "", :prev nil, :cmd ["Rscript" "adjcox.R"]}
as expected
Also surprisingly
bb test.clj
{:exit 0, :out "[1] 0\n", :err ""}
as expected.
Also (even more surprisingly) from the babashka terminal repl:
user=> (babashka.process/sh ["Rscript" "adjcox.R"])
{:proc #object[java.lang.ProcessImpl 0x9d1d8c3 "Process[pid=21750, exitValue=0]"], :exit 0, :in #object[java.lang.ProcessImpl$ProcessPipeOutputStream 0x185eca3d "java.lang.ProcessImpl$ProcessPipeOutputStream@185eca3d"], :out "[1] 0\n", :err "", :prev nil, :cmd ["Rscript" "adjcox.R"]}
as expected.
So we are only seeing the issue in the Calva REPL.