From hb at biostat.ucsf.edu  Sat Nov 15 06:49:37 2014
From: hb at biostat.ucsf.edu (Henrik Bengtsson)
Date: Fri, 14 Nov 2014 21:49:37 -0800
Subject: [Rd] Code tools for identifying which package A functions
 package B use?
In-Reply-To: <CAC2h7uutj2bg6676GXAX19j1-VrpRm5Zj76zjYOhXJ1iw4a9JA@mail.gmail.com>
References: <CAFDcVCQeSbJ29+Ou7szGFj=b1WiOr6junuyarW3oF7z3L1uT9g@mail.gmail.com>
	<CAC2h7uutj2bg6676GXAX19j1-VrpRm5Zj76zjYOhXJ1iw4a9JA@mail.gmail.com>
Message-ID: <CAFDcVCQRACa4cLaCJa=rDJy5gCbxA77Z_BRZGfvCztqp=dx9kQ@mail.gmail.com>

Thanks Kasper, that seems to do it:

$ url=https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/codetoolsBioC
$ svn checkout --username readonly --password readonly $url
$ R CMD build codetoolsBioC
$ R CMD INSTALL codetoolsBioC
$ R

> library("codetoolsBioC")
> deps <- findExternalDeps("MASS")
attaching required packages 'MASS'
Loading required package: MASS
> str(deps)
List of 4
 $ S4Classes: list()
 $ S4Methods:List of 1
  ..$ methods: chr "body<-"
 $ functions:List of 5
  ..$ base     : chr [1:248] "-" "!" "!=" "$" ...
  ..$ graphics : chr [1:16] "abline" "axis" "box" "frame" ...
  ..$ grDevices: chr [1:5] "dev.flush" "dev.hold" "nclass.FD" ...
  ..$ methods  : chr "new"
  ..$ stats    : chr [1:97] ".checkMFClasses" ".getXlevels" ...
 $ variables:List of 1
  ..$ base: chr [1:4] ".GlobalEnv" ".Machine" ".Options" "pi"
>

Great!

/Henrik

On Fri, Nov 14, 2014 at 8:41 PM, Kasper Daniel Hansen
<kasperdanielhansen at gmail.com> wrote:
> The best thing I have found is codetoolsBioC in the Bioconductor subversion
> repository.
>
> Best,
> Kasper
>
> On Fri, Nov 14, 2014 at 9:57 PM, Henrik Bengtsson <hb at biostat.ucsf.edu>
> wrote:
>>
>> Hi,
>>
>> I'd like to list all package PkgA functions that another package PkgB
>> use via Depends or Imports (ignoring Suggests for simplicity).  As
>> long as PkgB uses importFrom("PkgA", ...) it's just a matter of
>> parsing the NAMESPACE file or inspecting
>> asNamespace("PkgB")$.__NAMESPACE__.$imports.  However, what can be
>> done in case PkgB uses import("PkgA")?  Is there a function/package
>> already available for this?
>>
>> Thanks,
>>
>> Henrik
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>
>



[Rd] Code tools for identifying which package A functions package B use?
Henrik Bengtsson