[R] Rlanguage plr and loadiing climatol package

Joe Conway mail at joeconway.com
Sat Nov 20 22:35:30 CET 2010


On 11/20/2010 12:55 PM, David Winsemius wrote:
> On Nov 20, 2010, at 3:25 PM, David Potts wrote:
>> I am trying to call the R library function rosavent from the climatol
>> package via the plr interface package to the postgres database.

>> # 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'm not sure if not having loaded climatol is the source of your
> problem, but if it is, you have forgotten to load the package after
> installing it. Perhaps:
> 
> require(climatol)   # before the pdf(...) call

That would be needed for sure.

>> 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?

The R interpreter works just like the command line one in that respect
-- load the needed library in one of the usual ways from within the R
function if you want to use it.

> This page:
> http://www.varlena.com/GeneralBits/Tidbits/bernier/art13mar04/graphingWithR.html
> 
>  makes me thing that PL/R passes r code pg.spi.exec (... calls. Does it
> matter that the illustration on that page uses str<<- pg.spi.exec (
> rahter than str<- ?

<<- puts the variable in the global environment so that it is preserved
across PL/R calls to the R interpreter.

> (This would seem to be the wrong place to be asking these questions.
> There are websites set up to mediate conversations between PL/R users.)

Correct. Please see:
  http://www.joeconway.com/plr/
  http://pgfoundry.org/mail/?group_id=1000247

HTH,

Joe

-- 
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 899 bytes
Desc: OpenPGP digital signature
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20101120/17eada69/attachment.bin>


More information about the R-help mailing list