Skip to content

Instantly share code, notes, and snippets.

@andruby
Created May 9, 2009 23:50
Show Gist options
  • Save andruby/109446 to your computer and use it in GitHub Desktop.
Save andruby/109446 to your computer and use it in GitHub Desktop.
CREATE OR REPLACE FUNCTION r_scatter(title text, sql text)
RETURNS text AS
$BODY$
str <- pg.spi.exec (sql);
pdf('/tmp/scatter_plot.pdf');
plot(str,main=title,cex=0.3, pch=20,col=rgb(255,0,0,2,maxColorValue=255),ylim=c(0,100));
dev.off();
print('done');
$BODY$
LANGUAGE 'plr' VOLATILE;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment