R Programming Basics | Microsoft Tutorial
Key Takeaways
Writes and executes basic R code using Visual Studio Code
Full Transcript
Hello and welcome to this screencast on basic R code. Today we're going to dive into the essentials of scripting in R using Visual Studio Code as our development environment. Whether you're new to programming or just new to R, this session will help you get comfortable with the basics. Let's start by understanding the structure of an R script. Think of a script as a set of instructions that you give to the computer to perform specific tasks. In R. These tasks can range from simple calculations to complex data analysis. First, let's write a simple calculation. In your R script, type the following. Let's type in result followed by the assignment operator 5 + 3. Then we will print result. Finally, let's add some commenting. In this case, we'll add the following comment. We'll use hashtag or pound to start our comment and type in this is a simple addition in R. Now let's run this here in this problem. We're adding five and three and storing the result in a variable called result. Then we're printing it out. Notice that using the assignment operator in this case the less than minus sign that looks like an error arrow which is unique to R. R is case sensitive. So be mindful of how you name your variables. Also, comments in R are written using the hashtag symbol. As you can see here, it also colors it green. Comments are crucial for making your code understandable to others and to your future self. Now, to execute this code in VS Code, you can simply highlight the lines you want to run and press control enter or command enter depending of whether you're Windows or Mac. This will send the code to the R console and execute it. Let's try it again. Highlight it. Command enter. Now you should see the number eight printed in the console. As you can see, this is a result of our addition. Interpreting output is a very key skill here. The console output confirms that our code executed successfully and returned the expected value. If you encounter errors, check your syntax and ensure all of all the variables are correctly defined. Okay, now let's add a little bit more complexity. Let's clean our environment. Start by writing a function that multiplies two numbers. Let's type in multiply and then we'll autocomplete with the function x and y where we will ask to return the multiplication of x and y characterized by xar y. Now let's do using the function where we will define a variable called product assign it multiply. In this case let's do four and five. All right. Finally, let's print our product variable. So, press this. All right. Here we have defined the function multiply that takes two arguments and returns a product. We then call this function with the numbers four and five. Now, let's run this code the same way as before by highlighting it and doing command enter. You could see that 20 is printed in the console which is obviously the product of four and five. And there you have it. You've written and executed basic R code including a simple function. Remember, practice is key to becoming proficient in R. Keep experimenting with different operations and functions to deepen your understanding. Thank you for joining the screencast and happy coding.
Original Description
Start your R programming journey with this beginner-friendly tutorial. Learn to write and execute basic R code using Visual Studio Code, with step-by-step guidance from Microsoft's R Programming Certificate program.
🕐 Timestamps:
0:00 - Introduction
0:23 - Understanding R Scripts
0:43 - Writing Your First Calculation
1:05 - Adding Comments
2:01 - Executing Code in VS Code
2:46 - Basic Function Creation
3:38 - Running Functions
4:13 - Conclusion & Next Steps
🎓 This is a course preview of the *Microsoft R Programming for Everyone Professional Certificate* on Coursera. With the complete program, you'll:
• Learn to write efficient R code
• Collaborate through GitHub
• Analyze complex datasets
• Use AI tools to enhance productivity
• No prior programming experience needed
• Build a professional portfolio of hands-on projects using real datasets in a Microsoft development environment
Enroll now to access the complete 5-course program 👇
https://bit.ly/43VewzM
#RProgramming #DataScience #Microsoft
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Coursera · Coursera · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Principles of Obesity Economics with Professor Kevin Frick
Coursera
Introduction to the U.S. Food System: Perspectives from Public Health by John Hopkins University
Coursera
E-learning and Digital Cultures
Coursera
Equine Nutrition with Jo-Anne Murray
Coursera
Coursera Meetup BBQ
Coursera
Contraception: Choices, Culture and Consequences with Jerusalem Makonnen
Coursera
Nutrition for Health Promotion and Disease Prevention with Katie Clark
Coursera
Information Security and Risk Management in Context with Dr. Barbara Endicott-Popovsky
Coursera
Contraception: Choices, Culture and Consequences with Jerusalem Makonnen
Coursera
Writing in the Sciences with Kristin Sainani
Coursera
Economic Issues, Food, and You with Jennifer Clark
Coursera
Leading Strategic Innovation and Creativity in Organizations with David A. Owens, PhD
Coursera
Useful Genetics with Professor Rosie Redfield
Coursera
A History of the World since 1300!!!! with Jeremy Adelman
Coursera
Microeconomics with Richard McKenzie
Coursera
Discrete Optimization with Professor Pascal Van Hentenryck
Coursera
Leading Strategic Innovation and Creativity in Organizations with David A. Owens, PhD
Coursera
Science from Superheroes to Global Warming with Michael Dennin
Coursera
Introduction to Digital Sound Design with Steve Everett by Emory University
Coursera
Women and the Civil Rights Movement with Dr. Elsa Barkley Brown
Coursera
Galaxies and Cosmology with S. George Djorgovski
Coursera
Science, Technology, and Society in China I, II, and III: Basic Concepts with Naubahar Sharif
Coursera
Introduction to Pharmacy with Kenneth M. Hale, R.Ph., Ph.D.
Coursera
AIDS with Kimberley Sessions Hagen, EdD
Coursera
Health Informatics in the Cloud with Mark Braunstein
Coursera
Songwriting with Pat Pattison by Berklee College of Music
Coursera
Software Defined Networking with Dr. Nick Feamster
Coursera
Epigenetic Control of Gene Expression with Dr Marnie Blewitt
Coursera
Guitar for Beginners - Introduction to Guitar with Thaddeus Hogarth by Berklee College of Music
Coursera
Organizational Analysis with Daniel McFarland
Coursera
Scientific Computing with J. Nathan Kutz
Coursera
Jazz Improvisation - Introduction to Improvisation with Gary Burton by Berklee College of Music
Coursera
Principles of Economics for Scientists with Antonio Rangel
Coursera
Introduction to Music Production with Loudon Stearns by Berklee College of Music
Coursera
Principles of Public Health with Zuzana Bic
Coursera
The Science of Gastronomy with King Chow, Lam Lung Yeung by HKUST
Coursera
The Language of Hollywood: Storytelling, Sound, and Color with Scott Higgins by Wesleyan University
Coursera
Nutrition and Physical Activity for Health with John M. Jakicic, Ph.D., and Amy D. Rickman,...
Coursera
Nutrition, Health, and Lifestyle: Issues and Insights with Jamie Pope, MS, RD, L
Coursera
Survey of Music Technology with Jason Freeman by Georgia Institute of Technology
Coursera
Exercise Physiology: Understanding the Athlete Within with Mark Hargreaves
Coursera
Canine Theriogenology for Dog Enthusiasts with Margaret V. Root
Coursera
Web Intelligence and Big Data with Gautam Shroff
Coursera
Critical Perspectives on Management with Rolf Strom-Olsen
Coursera
El ABC del emprendimiento esbelto with Sergio Ortiz Valdes
Coursera
Interprofessional Healthcare Informatics with Karen Monsen
Coursera
Creativity, Innovation, and Change with Jack V. Matson, Darrell Velegol and Kath
Coursera
Innovacion educativa con recursos abiertos with Maria Soledad Ramirez Montoya an
Coursera
Inspiring Leadership through Emotional Intelligence with Richard Boyatzis
Coursera
Matematicas y movimiento with
Coursera
Sustainability of Food Systems: A Global Life Cycle Perspective with Jason Hill
Coursera
Latin American Culture with Enrique Tames
Coursera
Latin American Culture' with undefined
Coursera
Computer Security with Dan Boneh
Coursera
Introduction to Art: Concepts & Techniques
Coursera
Programmed cell death
Coursera
El ABC del emprendimiento esbelto
Coursera
Understanding economic policymaking
Coursera
History of Rock, Part 1 by University of Rochester
Coursera
Pensamiento Cientifico
Coursera
Related Reads
📰
📰
📰
📰
The new ChatGPT macOS app redesign has made basic navigation so much worse
Reddit r/artificial
Three Token-2022 Mints in One Week: Fees, Yield, and Soulbound
Dev.to · atharv shukla
Maximize Google Workspace AI Power: Safeguard Data and Boost Performance in 2026
Dev.to AI
What is Gemini Spark, and what can it actually do for you?
TechCabal
Chapters (8)
Introduction
0:23
Understanding R Scripts
0:43
Writing Your First Calculation
1:05
Adding Comments
2:01
Executing Code in VS Code
2:46
Basic Function Creation
3:38
Running Functions
4:13
Conclusion & Next Steps
🎓
Tutor Explanation
DeepCamp AI