Syntax
R Assign a Value Syntax
In R, assign a value: assigns a value to a variable — x <- 5
Quick Answer
- Syntax
x <- 5
RSyntax
Assign a Value
Assigns a value to a variable.
How to assign a value in R
- Open your R file or editor.
- Copy the example, then replace its sample names and values for your code.
R Assign a Value Syntax
Use x <- 5.
Related Syntax References
Frequently asked questions
What is the R syntax for assign a value?
Use this pattern: x <- 5
Can I copy this R code example?
Yes. Use Copy code and adapt the example to your program.
Is this R syntax different on Mac or Windows?
No. The language syntax is the same across operating systems.
Official source · How we verify