Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

The RStudio interface

Once you have started your RStudio session and connected to it, you should see something like the following:



On the left-hand side you have a single panel, which is the interactive console. While you can write interactive code here, you probably want to actually work with an R script. To start a new script, select File → New File → R Script from the menu bar. You should then end up with your interface looking like this:



You now have a source pane at the top left, where you can write your script. Use File→Save to save your script.

Running Code

To actually run some R code, type into the source pane (or load an existing R script). Then select the (portion of) code that you want to run, and click the Run button on the top edge of the source pane (or use Code → Run Selected Line(s) from the menu). You should end up with something like this:

Note that you can see the code you ran in the Console pane bottom left, and the variables that are now instantiated in the Environment pane top right.

Installing Additional Packages

  • No labels