I'm using Rstudio on my Mac OS 10.9.2. It was fine until I installed the new version 98.778. Whenever I try to save my script. It automatically calls source("myscript.R") for me, which is very annoying. I then re-installed the previous version, 98.501. The problem is still there. Anyone knows how to stop it?
Appreciate it.
When editing re-usable functions (as opposed to freestanding lines of R) you may wish to set the Source on Save option for the document (available on the toolbar next to the Save icon). Enabling this option will cause the file to automatically be sourced into the global environment every time it is saved.
You can save your script at any time (use Save in the File menu or the save shortcut, Ctrl+S or Cmd+S depending on your OS). After you've saved your work, close RStudio.
You can save your script by clicking on the Save icon at the top of the Script Editor panel. When you do that, a Save File dialog will open. The default script name is Untitled. R.
In addition, in Rstudio you can run the entire script by pressing Ctrl + Shift + Enter without selecting any code. In addition, there is a shortcut to source the current script file ( Ctrl + Shift + s ), which runs the script without echoing each line.
To save the script, you can either click on the blue save icon, use the keyboard commands Ctrl + S on Windows or Command + S on Mac OS or go to File > Save. This file will be open in RStudio the next time you reopen RStudio unless you click on the X on the file tab to close it. Viewing other files or data in RStudio
Initial RStudio Interface View To add a script file, either click on the green plus button on the upper left in the tool bar and select R Script or go to File > New File > R Script or on Windows use the commands Ctrl + Shift + N. On Mac OS this should be Command + Shift + N. Adding an R Script via the Add File Icon
If in doubt about which encoding to use, use UTF-8, as it can encode any Unicode character. The RStudio source editor can read and write files using any character encoding that is available on your system: You can choose the encoding for reading with File : Reopen with Encoding, which will re-read the current file from disk with the new encoding.
The RStudio IDE's Source Windows allow you to edit files outside the main RStudio window. This is useful for splitting your work among multiple monitors, or devoting more space to your editor. There are two ways to open a new source window: Pop out an editor: click the Show in New Window button in any source editor tab.
Are you sure "Source on save" box is unchecked?
You probably have the "source on save" checkbox ticked (next to the save icon on the left hand side in the code editor, not for saving the Rproject) which does this. (Untick it to turn it off)
http://www.rstudio.com/ide/docs/using/source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With