Variable assignment in R Question 2

R Programming Language / Variable in R Language

306

Program:

# Assign the value 5 to the variable my_apples
my_apples <- 5

# Print out the value of the variable my_apples
my_apples

Output:

> # Assign the value 5 to the variable my_apples
> my_apples <- 5
> 
> # Print out the value of the variable my_apples
> my_apples
[1] 5

Explanation:

  • Type the following code in the editor: my_apples <- 5. This will assign the value 5 to my_apples.
  • Type: my_apples below the second comment. This will print out the value of my_apples.

This Particular section is dedicated to Programs only. If you want learn more about R Programming Language. Then you can visit below links to get more depth on this subject.