I have used R in the past, but I just now installed RStudio IDE. It opens fine but in the Files Pane at the bottom right, I see files listed from all over my Windows 10 PC and I do not want them listed. But I do not want to delete them from my PC either. There does not seem to be any way to remove them from the list in the IDE without actually deleting them. How can I remove from them from the list without deleting them from my PC??
Hi Richard and welcome to the RStudio Community!
If you haven't already, create a new R project in RStudio. It will ask you where you'd like the project to be located on your computer. Once the project opens the Files pane will be empty except for a project file that maintains your project-specific settings. Then, as you create new R scripts these will be associated with the project and will appear in the Files pane.
You can learn more about projects on the RStudio web site.
Thanks very much for the reply! It seems odd, though, (to me) that the very first opening display of RStudio would show what looks like a random selection of files including ones that contain sensitive information, etc. And it seems odd that I have no way to control what gets displayed in that list other than (as it now seems to me) separately adding or removing files from a project directory. Why didn't RStudio just start with an empty file list and a note that a project needs to be created for files to show in the list????
The files pane is just a file explorer like any other, including the Windows File Explorer, the files it shows on first open are just the files present in your current working directory, which defaults to your system's HOME folder when no project is activated, and that is exactly the behavior that one should expect.
If you don't want t the default working directory to be your HOME folder, you can change the location in the global options.
I think you are thinking about the files pane as a sort of project explorer but that is not the case, you have to think of it as a project-aware, general-purpose file explorer. In such sense, a file explorer that shows an empty folder or that doesn't shows the complete content of the current folder wouldn't be much useful don't you think?
Thanks for responding. Perhaps I don't fully understand what constitutes the "Home" directory on a Windows 10 computer. What I saw when I first opened RStudio was a very odd collection of some 40 files and folders from all over my directory structure, and some happened to be sensitive files. That collection of files and folders in no way corresponds to the \user\username folder (which I thought was the so-called 'home' folder in current Windows systems) which has 116 files and folders.
Run getwd()
on the R console and you will know what the current working directory actually is.
As I said, the files pane doesn't shows an assembled list of files, it is just a file explorer so it shows the content of a given folder.
Also, you have to account for hidden folders, the file explorer doesn't show them by default but you can activate that option if you want the file count to match.
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.