Notes on rstudio

Then I show a screenshot of rstudio, in which the following are distinguished panels:

  • The interactive console R (on the left)
  • Environment / History (in the upper right corner)
  • Files / Graphics / Packages / Help / Viewer (Bottom right)

When opening files, as scripts R, editor panel will also open in the upper left corner.

There are two main ways in which one can work within rstudio.

  1. Try and play in the interactive console R and then copy the code into a file .R -poniéndolo in the upper left panel shown in the image and guardándalo- to run later.
    • This works well when small tests are done and / or is starting.
    • Quickly it becomes laborious.
  2. Start typing a .R file and use the shortcut keys rstudio to execute the current line, lines selected or modified in the interactive console.
    • This is a good start; all your code will be saved for later.
    • You can run the file you want from rstudio or by function source () R.
How to run code segments.

There are several ways to do this:

1.click on the button Run up in the Editor panel.

2. Select "Run Lines" from the "Code" menu

3. Press Ctrl-Enter on Windows or Linux Command-Enter in OS X. (This shortcut can also be done by placing the mouse over the button).

To run a code block, select it and then click Run. If you have modified a line of code within a block you just run, It is not necessary to re-select the block and Run, you can use the button Re-run the previous region. This will run the above code block, including changes you made.

 

 

Leave a Comment

Your email address will not be published.