[R] How do I call a masked function in a package without a namespace?

From: Dirk Koschuetzki <dkoschuetzki_at_gmx.de>
Date: Wed 16 Mar 2005 - 05:20:39 EST


Hello,

I work with two packages sna and graph from CRAN resp. Bioconductor. Both packages have a function called "degree". Therefore one of the functions is masked by the other and which one gets called depends on the order of loading. The problem is that both package do not have a namespace, therefore calling the masked function with "package::degree" does not work. See the following transcript:

$ R --vanilla

[[ Running on Debian Sarge ]]

R : Copyright 2004, The R Foundation for Statistical Computing Version 2.0.1 (2004-11-15), ISBN 3-900051-07-0 [...]

> library("sna")
> library("graph")

Loading required package: cluster
Loading required package: Ruuid
Creating a new generic function for "print" in "Ruuid" Loading required package: Biobase
Loading required package: tools
Welcome to Bioconductor

          Vignettes contain introductory material.  To view,
          simply type: openVignette()
          For details on reading vignettes, see
          the openVignette help page.

> conflicts()
[1] "last.warning" "degree" "body<-" "print" "split"
[6] "union"

> sna::degree()

Error in loadNamespace(name) : package 'sna' does not have a name space
> graph::degree()


Error in loadNamespace(name) : package 'graph' does not have a name space
> sna:::degree

Error in loadNamespace(name) : package 'sna' does not have a name space
> graph:::degree

Error in loadNamespace(name) : package 'graph' does not have a name space

Is there a way to call the masked function via a different way? And I wold like to create my own function degree which will of course masked both functions and should therefore be able to call both functions.

Thanks for any hint!

Cheers,
Dirk



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Mar 16 05:22:07 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:30:48 EST