Sha256: 9c6dca802d64d85fe3df838af87fb922e0639cad5156185209698b6001fdc090
Contents?: true
Size: 852 Bytes
Versions: 24
Compression:
Stored size: 852 Bytes
Contents
- filename = 'R-png_' << rand(10000).to_s unless defined? filename and filename - text = filename unless defined? text and text - size = 500 unless defined? size and size - width = size unless defined? width and width - height = size unless defined? height and height - plot = block.call unless (defined? plot and plot) or not defined? block - filename += '.png' unless filename =~ /\.png$/i - require 'rbbt/util/R' = resource filename, text, :image do |filename| - TmpFile.with_file(plot) do |plot_file| - if defined? data - data.R "rbbt.require('readr'); plot_str <- read_file('#{ plot_file }'); rbbt.png_plot('#{filename}', plot_str, width=#{width}, height=#{height})" - else - R.run "rbbt.require('readr'); plot_str <- read_file('#{ plot_file }'); rbbt.png_plot('#{filename}', plot_str, width=#{width}, height=#{height})"
Version data entries
24 entries across 24 versions & 1 rubygems