lib/rbbt/util/R.rb in rbbt-util-5.21.77 vs lib/rbbt/util/R.rb in rbbt-util-5.21.78
- old
+ new
@@ -196,16 +196,17 @@
tsv
end
end
end
- def R_interactive(pre_script = nil)
+ def R_interactive(pre_script = nil, source = true)
TmpFile.with_file do |f|
Log.debug{"R Interactive:\n" << pre_script } if pre_script
TmpFile.with_file(pre_script) do |script_file|
Open.write(f, self.to_s)
script = "data_file = '#{f}';\n"
script << "script_file = '#{script_file}';\n" if pre_script
+ script << "source(script_file);\n" if source
R.interactive(script)
end
end
end