<- (assignment)
Assigns a value to a variable.
Syntax
name <- value
Description
Assignment in R is done with <- (= also works). The type is inferred from the value; the value can be changed later. class(x) returns the type.
Example
Loading editor…
Expected output
R 20
When to use?
General-purpose variable definition.