R
About
R langugage is used for statistical computing and graphics.Basics
- help(<function>) -OR- ?<function>
- ls() -OR- objects()
- x <- c(1, 2) -OR- c(1,2) -> x
- x <- c(1,1,1,1)
- y <- c(x,x)
- v <- 2*x + y + 1
- v
- [1] 4 4 4 4 4 4 4 4 4 4
- 1:10
- [1] 1 2 3 4 5 6 7 8 9 10
- 2*1:10
- [1] 2 4 6 8 10 12 14 16 18 20
- seq(2,10) -OR- 2:10
- x <- c(1,2,3,4,5)
- v1 <- rep(x,times=5)
- [1] 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
- v2 <- rep(x,each=5)
- [1] 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5
Last Updated 23 Aug 2021