08 Feb R Variables
Variables are reserved memory locations. In Python, you only need to assign a value for variable declaration. This works the same for the R programming language. Let’s see.
Create a Variable in R
An R variable gets created when a value is assigned. That is it! The following sign is used to assign a value to a variable:
1 2 3 |
<- |
Let us create a variable in R and print a number:
1 2 3 4 5 6 |
marks <- 96 # Output Marks |
Multiple Variables
Let us now see how to display multiple variables in the R programming language:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# string name <- "Amit Diwan" # number rank <- 1 # number marks <- 96 # float points <- 125.40 # display name rank marks points |
Output
1 2 3 4 5 6 |
[1] "Amit Diwan" [1] 1 [1] 96 [1] 125.4 |
If you liked the tutorial, spread the word and share the link and our website Studyopedia with others.
For Videos, Join Our YouTube Channel: Join Now
Read More:
No Comments