I am trying to a shortcut such that I can open all the r scripts in a file at once without clicking multiple times of open files.
I have already tried find in files
but it cannot read all the files at once...
Please give me some suggestions, thank you!
You can iterate over a vector of file names calling rstudioapi::documentOpen()
. For example, to open all files with a .R
extension in the working directory:
lapply(list.files(pattern = "\\.R$"), rstudioapi::documentOpen)