This checks if the library function is called with a variable as its parameter. As it turns out, you cannot pass a variable to library. library's documentation says that the package argument should be either a name or a string. Here is some code demonstrating that a variable cannot be used.
> x <- devtools
Error: object 'devtools' not found
> x <- "devtools"
> library(x)
Error in library(x) : there is no package called ‘x’
> library("devtools")
> library(devtools)
When you do this check, something goes wrong that results in a "Failed on Library" error that stops the static analysis. I discovered this with doi:10.7910/DVN/383K6K - Descriptives.R, and confirmed that if I comment out the line shown above, static analysis completes. Descriptives.R contains the following, and I expect this will be very easy to reproduce:
The identify_packages function in static_analysis.R on the dev branch calls:
This checks if the library function is called with a variable as its parameter. As it turns out, you cannot pass a variable to library. library's documentation says that the package argument should be either a name or a string. Here is some code demonstrating that a variable cannot be used.
When you do this check, something goes wrong that results in a "Failed on Library" error that stops the static analysis. I discovered this with doi:10.7910/DVN/383K6K - Descriptives.R, and confirmed that if I comment out the line shown above, static analysis completes. Descriptives.R contains the following, and I expect this will be very easy to reproduce: