At one point I decided I wanted a really simple command line barplot (easily adaptable to histogram or scatter plot etc) maker that I could stick at the end of a pipeline. I didn't know a lot of R at the time, nor did I know about littler (it might not have even existed yet) so I would up doing a hacky embedding of R in perl. It works, though. I wouldn't write it like this again since I know a heck of a lot more R now, but it has been useful to me as is. The only major problem is that since there is no event loop, the program has to be keep alive artificially to keep the window from disappearing. You will need the RSPerl package and scripts as explained here http://www.omegahat.org/RSPerl/
#!/usr/bin/perl -w
use strict;
use R;
use RReferences;
&R::startR("--no-save", "--silent");
my $header = <>;
chomp $header;
my @header = split(/,/, $header);
my @x;
my @y;
while(<>){
chomp;
my @fields = split(/,/);
push(@x, $fields[0]);
push(@y, $fields[1]+0);
}
R::callWithNames("barplot", {"height",\@y, "data",\@x, "xlab",$header[0], "ylab",$header[1] });
print "Ctrl-C to exit\n";
while(sleep(60)){}