Closed jfmoyen closed 2 years ago
I see the issue and understand why it is happening. The problem is that there the plugin needs to check if the package exist and install it otherwise. On the other hand, there is not much point in using quietly=T
for scripts runned in QGIS. The text outcome of library load is not that disturbing and does not cause any issues.
It could be solved, by parsing library(MASS,quietly=T)
to get package name and parameters, but I am slightly against that as it could potentially introduce a new set of issues.
I was using MASS as an example of a library that everybody probably has, the actual script uses a home-made library that does many other things and for which it made sense to pass startup options. Point taken though.
We have a script that runs a home-made library, I'm using here MASS as a quick MRE:
and works fine (in this case, of course it returns nothing so working 'fine' is relative).
However, if we modify the script like that
or in fact by adding any other option to library()
we get the following:
Error in library("MASS,quietly=T") : there is no package called 'MASS,quietly=T'
This seems to be because the parser takes the whole content of library() and quotes it: