lib/rbbt/util/R.rb in rbbt-util-5.14.24 vs lib/rbbt/util/R.rb in rbbt-util-5.14.25
- old
+ new
@@ -24,11 +24,11 @@
end
Log.debug{"R Script:\n#{ cmd }"}
if options.delete :monitor
- io = CMD.cmd('R --vanilla --slave --quiet', options.merge(:in => cmd, :pipe => true))
+ io = CMD.cmd('R --vanilla --slave --quiet', options.merge(:in => cmd, :pipe => true, :log => true))
while line = io.gets
puts line
end
nil
else
@@ -83,22 +83,23 @@
module TSV
def R(script, open_options = {})
TmpFile.with_file do |f|
Open.write(f, self.to_s)
- io = R.run(
- <<-EOF
+
+ script = <<-EOF
## Loading tsv into data
data = rbbt.tsv('#{f}');
#{script.strip}
## Resaving data
if (! is.null(data)){ rbbt.tsv.write('#{f}', data); }
EOF
- )
- Log.debug(io.read)
+ r_options = Misc.pull_keys open_options, :R
+ io = R.run script, r_options
+
open_options = Misc.add_defaults open_options, :type => :list
if open_options[:raw]
Open.read(f)
else