Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #R assignmment operators
- x= 3 + 4
- x
- x <- 3 +4
- x
- switch ('a', 'a' = {x = x + 5;},
- 'b' = {x = 999}, 'c' = {x = 'ABC'})
- x
- m1 <- m2 <- 3
- m1 = m2 <- 3
- m1 <- m2 = 3
- mean(1:5) #used to save memory as a function assignment
- mean(x <-1:5) #used as a variable assignment
- mean(1:5) #not using variable
- x <- y <-5 #statement is oke
- a = b = 5 #statement is oke
- m = n <-5 #statement is oke
- p <- q = 5 #Error in p <- q = 5 : 找不到物件 'p'
- #Logical Vector
- c(T, F, TRUE, FALSE)
- #Integer Vector
- c(1L, 2L, 3L, 4L, 0xaL)
- #Numeric Vector
- c(1.0, .1, 1e-2, 1e2, 1.2e2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement