[R] Defining/Checking constants in packages

Barry Rowlingson B.Rowlingson at lancaster.ac.uk
Thu Nov 21 17:02:58 CET 2002


This:

> 	> get("pi", pos="package:base")
> 	[1] 3.141593

Doesn't seem to work for me:

 > get("pi", pos="package:base")
[1] 0

Now, that might be because I've redefined 'get':

 > get
function(x,pos=y){0}

:)

  So maybe if I am scared someone has redefined 'pi', I should also be 
paranoid about them redefining 'get'. However, I cant use:

get("get", pos="package:base")

  because my 'get' is already poisoned. So how can I reliably get the 
'get' in package:base:

 > base::get("pi",pos="package:base")
[1] 3.141593

?

Baz

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list