Skip to content
Prev 309726 / 398502 Next

finding global variables in a function containing formulae

On Thu, Nov 1, 2012 at 2:04 PM, Hafen, Ryan P <Ryan.Hafen at pnnl.gov> wrote:
If this is only being applied to your own functions then we can have a
convention when writing them to help it in which we "declare" such
variables so that findGlobals can locate them:


plotFn1 <- function() {
   xGlobal; yGlobal
   plot(yGlobal ~ xGlobal)
}

findGlobals(plotFn1)