[R] Rlanguage plr and loadiing climatol package
David Potts
dave.potts at pinan.co.uk
Sat Nov 20 21:25:16 CET 2010
Hi List
I am trying to call the R library function rosavent from the climatol
package via the plr interface package to the postgres database.
My code is a follows
create or replace function w_graph() returns text as
'
str <- pg.spi.exec("select
n,nne,ne,ene,e,ese,se,sse,s,ssw,sw,wsw,w,wnw,nw,nnw from wdata");
pdf("/tmp/foobar.pdf");
rosavent(str,4,4,ang=-3*pi/16,main="Annual windrose")
dev.off();
print("Done");
'
LANGUAGE plr;
When invoked it gives the error
# select w_graph();
ERROR: R interpreter expression evaluation error
DETAIL: Error in PLR7843132 <- function() { : could not find function
"rosavent"
CONTEXT: In PL/R function w_graph
I assume this means it can not find the rosavent function from the
climatol package.
I have loaded the climatol package using the following syntax
install.packages("climatol",lib="/home/dfuncs/r-lang/my-rlib")
I assume that the an R process created by the plr interface will load a
library, does any body know how I tell it to load it?
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Any views expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of the
Pinan Software
More information about the R-help
mailing list