findGlobals() produces Error in e[[4]] : subscript out of bounds
f <- function(x) { x %>% `$<-`(a, 42) }
codetools::findGlobals(f)
produces:
Error in e[[4]] : subscript out of bounds
> traceback()
11: walkCode(e[[4]], w)
10: h(e, w)
9: walkCode(a, w)
8: collectUsageArgs(e, w)
7: w$call(e, w)
6: walkCode(e[[i]], w)
5: h(e, w)
4: walkCode(body, w)
3: collectUsageFun(name, formals(fun), body(fun), w)
2: collectUsage(fun, enterGlobal = enter)
1: codetools::findGlobals(f)
This is with:
> packageVersion("codetools")
[1] ‘0.2.19’