This is not a real lab. This is a practice lab. It serves two purposes:
For this lab, you will create a single
.R file called
lab00.R. The following exercises will ask you to write code. Place all requested code in this
.R file separated by comments which indicate which code corresponds to which exercise.
Note: A comment in R begins with a
#. For example:
# this line is a comment, the following line is real code print("This is code that will run!")
Copy-paste the above code into an R console. You’ll find that the first line has no effect (because it was commented) while the second line will create output.
Submit your lab to the corresponding assignment on Canvas. We will “grade” your lab as a way of letting you know that you have submitted a lab that matches our expectations. You have unlimited attempts before the deadline. Your final submission before the deadline will be graded.
This lab is not graded. However, this section exists to show that in general, we will provide information on how each individual lab is graded.
It is tradition when learning a new programming language for the first program you write to be something called “Hello World.” That is, your task is to write code which returns
In R, the code to accomplish this task is:
Place this code in your
.R file for this exercise. Also, run the code!
Write R code that does the following:
athat stores the value
bthat stores the value
cthat stores the integers from