The first time I tried it out it worked perfectly, but later when I re-knitted the document, this funny window popped up
I was quite surprised! Oh, what had I done now?
To cut the story short, the answer lies in the R documentation via
pkgs (3rd paragraph), when zero-length, is what produced the popup. After installing the missing packages in the first pass of the code I wrote, the vector
not_installed was subsequently zero-length. As an example, when one does this…
…our listbox appears.
I therefore decided to throw in a conditional statement to skip the installation step in the event that all required packages are already present: