

They are very simple and can be read by many different computer programs-even the most basic text editors. Plain-text files are one of the most common ways to save data. How you open files in your working directory will depend on which type of file you would like to open. If you see the file that you would like to open in your working directory, then you are ready to proceed. You can see what files are in your working directory with list.files(). If you start R from a UNIX command line (as on Linux machines), the working directory will be whichever directory you were in when you called R.

#Rjava pass dataframe from java to r without csv mac#
The Windows and Mac GUIs have similar options. You can also change your working directory by clicking on Session > Set Working Directory > Choose Directory in the RStudio menu bar. If the file path does not begin with your root directory, R will assume that it begins at your current working directory. For example: setwd( "~/Users/garrettgrolemund/Documents/Book_Project") That way I can keep all of my data, scripts, graphs, and reports in the same place. I prefer to set my working directory to a folder dedicated to whichever project I am currently working on. Just give setwd the file path to your new working directory.

You can move your working directory to any folder on your computer with the function setwd. You can place data files straight into the folder that is your working directory, or you can move your working directory to where your data files are. To determine which directory R is using as your working directory, run: getwd() The location of your working directory will vary on different computers. This is where R will look for files when you attempt to load them, and it is where R will save files when you save them. Each time you open R, it links itself to a directory on your computer, which R calls the working directory.
