R Studio For Mac Oregon State University

Oregon State Ecampus offers 50+ accredited online degrees, undergraduate and graduate, including business, computer science, natural resources and fisheries and wildlife.

In Review

Getting Started With RStudio

Open RStudio and a window like the one below should open. Across the top is a standard menu bar with typically menu items that we will look at in a little while. In the left-hand pane is a 'console' window for R command. On the right is a 'Workspace' panel that will show you the variables (also known as 'objects') that you are working with in R. On the bottom right is a pane that will display plots you create.

There are only a few things you need to know about using R Studio to get through your first tutorials.

Click in the 'Console' and you should see a blinking 'caret' appear next to the greater than sign ('>'), referred to as a 'prompt'. This is where you'll type R Commands to immediately execute one command at a time. If a plus sign ('+') appears while in the console, it means that R is wanting you to enter some additional information. Press escape ('esc') and hit return to get back to the '>' prompt.

Now, you can continue on with the tutorial below by just using the 'R Console' on the left-hand side of RStudio.

Getting Started in R

The best introduction to using R is a 'self-learn tutorial from The National Center for Ecological Analysis and Synthesis at The University of California at Santa Barbara. The tutorial will talk you through the basic operations of R and explain how R works with data, operations, and functions. A link to it is provided below and I recommend going through the tutorial in detail before proceeding.

R A self-learn tutorial - start here

Below is a link to the introduction to R that is on the R web site. While this tutorial contains a great deal of documentation on R, it moves rather quickly and also introduces concepts that are not key to spatial statistics. I would recommend reviewing it periodically.

Introduction to R - very concise introduction

From here, go through each of the topics in the contents for this web site. The sections are by topic and the

More on RStudio

While the tutorials will get you started using R in an 'interactive' mode, you'll want to start writing larger scripts. In RStudio, select 'New Script' from the 'File' menu.

You'll now see a 'Script' panel appear. Try typing a command into this panel and then press the 'Run' button shown below. You should see the results of running the script appear in the console panel.

The Run button will execute one line of code if you have the blinking caret, otherwise, it will execute a selected block of code. Try entering several lines of code now and clicking run.

The scripts in RStudio work very much like individual files in editors and spreadsheet packages. However, the other panels are a little different and are saved together in a workspace when you exit RStudio. This workspace will be reopened each time you open RStudio. To clear the contents of each workspace:

  • Console: From the 'Edit' menu, select 'Clear Console'
  • Workspace: From the 'Workspace' menu, select 'Clear All...'
  • Plots: From the 'Plots' menu, select 'Clear All...'

Now you can start writing much larger scripts that execute a series of operations. When you are not sure where your script is at, try clearing everything and then selecting the entire script and running it.

Other Resources

R studio for mac oregon state university

R Studio Documentation - Full Documentation for RStudio

1. Getting Started

The first lessons below will introduce you to using R. These lessons are not focused on spatial data but on the basic operations of R you'll need for working with Spatial Data.

2. Exploring Tabular Data

These lessons will show you how to create data in R and use R to explore data.

3. Control Flow

4. Packages and Libraries

5. Exploring Spatial Data

6. Interpolation

  1. Spatial Statistics (incomplete)

7. Correlation/Regression Models

8. Monte Carlo Methods

9. Additional Information

Acknowledgments

R Studio For Mac Oregon State University

The material in this web site was drawn from a large number of web sites, blogs, articles, and books. Special thanks go to Jose Montero for contributing content.