0
0
R Programmingprogramming~15 mins

Running R code in R Programming - Mini Project: Build & Apply

Choose your learning style9 modes available
Running R code
📖 Scenario: You want to learn how to run simple R code to do basic calculations and see the results.
🎯 Goal: Write and run R code step-by-step to create variables, perform calculations, and print the results.
📋 What You'll Learn
Create variables with exact names and values
Use arithmetic operations in R
Print output using print()
💡 Why This Matters
🌍 Real World
Running R code is the first step to analyzing data, creating reports, and building statistical models.
💼 Career
Many jobs in data science, statistics, and research require running R code to process and understand data.
Progress0 / 4 steps
1
Create variables
Create a variable called a and set it to 10. Create another variable called b and set it to 5.
R Programming
Need a hint?

Use the assignment operator <- to assign values to variables in R.

2
Calculate sum
Create a variable called sum_ab that stores the sum of a and b.
R Programming
Need a hint?

Use the + operator to add two variables.

3
Calculate product
Create a variable called product_ab that stores the product of a and b.
R Programming
Need a hint?

Use the * operator to multiply two variables.

4
Print results
Use print() to display the values of sum_ab and product_ab.
R Programming
Need a hint?

Use print(variable_name) to show the value of a variable.