From pauljohn32 at gmail.com  Mon Oct 10 17:31:20 2011
From: pauljohn32 at gmail.com (Paul Johnson)
Date: Mon, 10 Oct 2011 10:31:20 -0500
Subject: [Rd] "What Calls What" diagram. Flow Chart?
In-Reply-To: <3D59DF35E7CF3E42BA70C23BD5CBE6A85F5E6034FE@exvic-mbx04.nexus.csiro.au>
References: <CAErODj9AZS1JnnKXDGP1-Pv0NkT941Rt8sV15o5Gy08Gn-5PDw@mail.gmail.com>
	<3D59DF35E7CF3E42BA70C23BD5CBE6A85F5E6034FE@exvic-mbx04.nexus.csiro.au>
Message-ID: <CAErODj85qgWCf7hUhZ5-dr0LuQ=7KfX-=xGndjybq6gqwK=JMA@mail.gmail.com>

On Sun, Oct 9, 2011 at 5:29 PM,  <Mark.Bravington at csiro.au> wrote:
> Hi Paul
>
> Have you tried
>
> mvbutils::foodweb( where=asNamespace( 'lavaan'))
>
> (assuming lavaan has a namespace, otherwise where='package:lavaan')?
>
> Sounds like it's what you're after--
>
> Mark
>
Thanks, Mark. The foodweb graph for lavaan is a bit overwhelming.

The graph shows everything it finds that might be called any time, it
doesn't help me trace the path of a specific user call to a particular
function. So I'm not entirely sure it is doing what I hope for.

While matching the graph against the source code, it seems to me some
R language idioms can confuse/break the foodweb.  When eval is called
on a string object, then I think function calls can escape detection.
In the cfa example code I put in the original post, the function
"lavaan" is called by eval, and as far as I can tell in the foodweb
output, that connection is not found.

I'm still studying your package, of course, but here's (I think) an
example, I know "cfa" does call "lavaan" though eval, but this code

library(lavaan)
library(mvbutils)
mvbutils::foodweb( where=asNamespace( 'lavaan'))

myfw <- mvbutils::foodweb( where=asNamespace( 'lavaan'))

callers.of("lavaan", myfw)


> [1] "independence.model"      "independence.model.fit"
[3] "independence.model.fit2" "setLavaanOptions"




-- 
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas



[Rd] "What Calls What" diagram. Flow Chart?
Paul Johnson