1.7 Running scripts

To run a command from the script file,

  1. place your cursor on the line you want to execute and
  2. click the “Run Current Line” icon at the top left corner of the script editor.
  3. You may also use the short-cut keys: command + return on a Mac or CTRL + Enter with a Windows operating system.

R will return an error if you select only part of a command. So, place your cursor in the line you wish to execute or drag to select the entire command.

ADD: Watch a video to show you how to run an R script file.