Entering edit mode
Seth Falcon
★
7.4k
@seth-falcon-992
Last seen 10.3 years ago
Paul Shannon <pshannon at="" systemsbiology.org=""> writes:
> Hi Seth,
>
> If you are digging around in the innards of the graph package, I
have
> another suggestion -- an imperfect one -- to suggest.
>
> I sometimes use biomaRt and graph in the same project. biomaRt
> requires XML which has, like graph, a method called 'addMode':
>
> library (biomaRt)
> Loading required package: XML
>
> Attaching package: 'XML'
>
> The following object(s) are masked from package:graph :
> addNode
>
> I can work around this just fine by calling graph::addNode, but
maybe
> an alias could be adopted as well, and then favored over the long
> term -- 'add.node' or some such thing.
>
> Or maybe this isn't worth bothering with.
I think there is a solution in this particular case, but it is _not_
to rename the addNode function in any package -- that solution will
break as soon as some other package defines such a function. In the
long run, I think that folks are going to have to get used to using ::
to disambiguate. Note that you can create an alias for yourself:
g_addNode = graph::addNode
And if you are not working interactively, then you can import and
rename:
importFrom("graph", g_addNode=addNode)
But for the case of biomaRt, I think the solution is for biomaRt to
import XML and not have the XML package attached to the search path.
This will prevent pollution of the search path with functions from
XML.
+ seth
--
Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research
Center
BioC: http://bioconductor.org/
Blog: http://userprimary.net/user/