Assignment operators & assign function in R
x = 9 # assignment operator, equal to symbol
x <- 5 # assignment operator (recommended), less than
x <- 1:4
8 -> var # assignment operator, greater than
for better readability of R code, use <- for assignment and = for specifying named parameters.
<-, <<-, = # Leftwards assignment
->, ->> # Rightwards assignment
assign("x", 10) # assignment function, in R language
assign("x", c(8,3,9999))
assign("vect", 1:10)
assign("a", 3, envir = e1)
Related aRticles: R Jargon Distributions in R
No comments:
Post a Comment