What are the different ways to run R code?
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →1. Watch the assigned videos and digest the corresponding lecture notes.
2. Complete the homework “rmd exercise” file up to the part that’s covered in the video. Please spend time on doing the readings as outlined in the file, and follow the guideline to complete the code chunks.
Suggestion: do 1 and 2 sequentially for one video at a time.
Important: Watching the videos and complete the homework “rmd exercise” should be done BEFORE the joining upcoming lab session.
3. Join the lab session for extra “lab exercise”. The lab exercise file will be made available when the class starts. ***The lab submission is password protected, and you can get it only by attending the class in person.***
In summary, there are two types of exercises for this class:
The homework “rmd exercises” are designed to accompany the lecture notes, which should be done before the lab sessions. You can ask questions about them during the lab session. There is one homework submission for each chapter.
The “lab exercises” are the additional applications which will be completed during the lab sessions. These are also required for submission (one submission per class).
—
Video 1-00 Why use R?
There are so many good reasons to use R!
—
Video 1-01 The different ways to run R code (14:37)
In this video, I introduce to you the concept of “code chunk”, which is how you run code in the R Markdown file, and the output will be embedded in the same document. Alternatively, you can run code in the “Console”, one line at a time. The third way to run R code is to use the R script file, where you can run multiple lines of code in batch. The advantage of using R Markdown file to run code is that you are writing code and report in the same place.
Review questions:
1. What are the different ways to run R code?
2. How to toggle on and off the outline pane for an RMD file?
3. How to insert a code chunk in an RMD file?
4. How to run a code chunk in an RMD file?
—
Video 1-02 Variables
We learn how to create new variables in R, which are used for storing values. Your variable names should be valid and meaningful!
Review questions:
1. What are variables and how to create them in R?
2. What is the syntax requirement in naming a variable?
3. How to write comments in R? Why is it good idea to write comments?
Requirements: as specified
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds