Skip to content

R Lecture 3: Our First Program!


This is the third in a series of lectures on R.

(DAV, I kept the intro for one last time.)

Open the myRcode.R file we saved in our myR folder. Windows users have it in their “C” drive. Mac users have it on their Desktop.Linux users have it in their home path.

Reminder: DO NOT USE MICROSOFT WORD.

Cut and paste or type the following block of text into your myRcode.R file and SAVE it.


x = 7
y = 8
x + y
x * y
x * Y
x / y
x^y

We will cut & paste this code from the file myRcode.R into the R command window. EACH TIME REMEMBERING TO HIT THE ENTER KEY (inside R).

R can be downloaded here: R-project.org. A direct link to the CRAN package archive is here.

Next time: finding commands and plotting! The next lesson will appear on the weekend.

All videos are on YouTube— 10 minutes is a shockingly short period of time!—under the username “mattstat” (wmbriggs was taken). That service imposes a ten-minute limit of videos. Accordingly, lectures are short.

All questions to matt@wmbriggs.com.

One thought on “R Lecture 3: Our First Program! Leave a comment

  1. S’Okay. I figured it was your eclecticism or an overwhelming desire to highlight a Detroit son (or both?). A sidenote: I interrupted Julian Bream’s rendition of the adagio movement from Rodrigo’s Concierto De Aranjuez to listen to the podcast.

Leave a Reply

Your email address will not be published. Required fields are marked *