1

I have a set of helper functions that open groups of related source files. This works great, except for one issue: I would like to open the files in a new window.

Here's basic code:

..open.source.files <- function(Group = "OUT_CONFIG"){
       
        if(Group == "OUT_CONFIG" | Group == "YAML")
        {
            rstudioapi::navigateToFile('_output.yml')
            rstudioapi::navigateToFile('_bookdown.yml')
        }
    
        if(Group == "OUT_CONFIG" | Group == "LATEX")
        {
            rstudioapi::navigateToFile('./tex/packages.tex')
            rstudioapi::navigateToFile('./tex/docClass.cls')
            rstudioapi::navigateToFile('./tex/dissertation_template.cls')
        }
    }
}

How can I get these files to open to a new window, instead of just having them all open in the main window.

Rstudio allows for a "new window" using the GUI in the taskbar by clicking on the taskbar button to launch new window:

I would like to be able to do the same using code.

Would love to know if anyone has an tips.

Thank you!

HoneyBuddha
  • 748
  • 8
  • 15
  • 2
    This is probably a better question for https://community.rstudio.com/ – MrFlick Aug 27 '20 at 03:14
  • A thread has been started on https://community.rstudio.com/t/rstudio-open-source-file-in-new-window-using-rstudioapi-navigatetofile/77742 Once a solution is found, I will address the cross-posting as advised. – HoneyBuddha Aug 29 '20 at 06:30

0 Answers0