lib/rbbt/util/R.rb in rbbt-util-5.14.32 vs lib/rbbt/util/R.rb in rbbt-util-5.14.33
- old
+ new
@@ -91,11 +91,11 @@
when TSV
"matrix(#{R.ruby2R object.values},dimnames=list(#{R.ruby2R object.keys}, #{R.ruby2R object.fields}))"
when Symbol
"#{ object }"
when String
- "'#{ object }'"
+ object[0] == ":" ? object[1..-1] : "'#{ object }'"
when Fixnum, Float
object
when TrueClass
"TRUE"
when FalseClass
@@ -118,10 +118,11 @@
module TSV
def R(script, source = nil, open_options = {})
open_options, source = source, nil if Hash === source
+ source ||= Misc.process_options open_options, :source
source = [source] if String === source
require_sources = source.collect{|source|
"source('#{source}');"
} * ";\n" if Array === source and source.any?
@@ -151,9 +152,10 @@
#{script.strip}
## Resaving data
if (! is.null(data)){ rbbt.tsv.write('#{f}', data); }
+NULL
EOF
case r_options.delete :method
when :eval