I have a simple script file called test.R. It\'s saved in the working directory. When I go to File > Open > test.R, it opens the file in the edit
test.R
File > Open > test.R
I had the same issue that utils::file_edit() within my package opens outside R-studio. I changed it to usethis::edit_file(). With this function the file opens inside R-studio.
utils::file_edit()
usethis::edit_file()