I tried in on the most recent build RStudio 2022.07.0 Build 548, 64-bit, Windows 10, but the prompt still doesn’t appear. Here are the steps to reproduce.
- Create a new R Script (Ctrl + Shift + N)
- Paste the code below
- Select all (ctrl + A)
- Run selection (ctrl + Enter)
library(tidyquant)
google <- tq_get(x = "GOOG")
names(google)
As far as I can see there's no prompt or dialog to install the tidyquant library and the output is just this:
library(tidyquant)
Error in library(tidyquant) : there is no package called ‘tidyquant’
google <- tq_get(x = "GOOG")
Error in tq_get(x = "GOOG") : could not find function "tq_get"
names(google)
Error: object 'google' not found
I know how to install packages, but I want our users (medical researchers) to automatically get a prompt for any missing packages when they are working with our R scripts.