lib/rbbt/util/R.rb in rbbt-util-5.21.98 vs lib/rbbt/util/R.rb in rbbt-util-5.21.99

- old
+ new

@@ -20,12 +20,11 @@ source('#{UTIL}'); EOF require_sources = source.collect{|source| - source = R::LIB_DIR["plot.R"] if source == :plot - source = R::LIB_DIR["svg.R"] if source == :svg + source = R::LIB_DIR["#{source.to_s}.R"] if R::LIB_DIR["#{source.to_s}.R"].exists? "source('#{source}')" } * ";\n" if Array === source and source.any? cmd << require_sources + "\n\n" if require_sources @@ -148,10 +147,10 @@ source ||= Misc.process_options open_options, :source source = [source] unless Array === source require_sources = source.collect{|source| - source = R::LIB_DIR["plot.R"] if source == :plot + source = R::LIB_DIR["#{source.to_s}.R"] if R::LIB_DIR["#{source.to_s}.R"].exists? "source('#{source}')" } * ";\n" if Array === source and source.any? script = require_sources + "\n\n" + script if require_sources