To input scalar value into variables, use -> operator.
1 | x <- 2 |
Also, you can input vector easily. Use the function of c()./p>
1 | v <- c (2,2,3,4) |
When you want to inspect specific index of a vector, command like following.
1 2 | v <- c (2,2,3,4) v[2] |
You can combine vectors.
1 2 | x <- c (1, 2, 3); y <- c (4, 5, 6); z <- c (7, 8, 9) v <- c (x, y, z) |
You can hold the data as table form. Use the function of data.frame. When you want to inspect specific column of data frame, use the operator of $.
1 2 3 | x <- c (1, 2, 3); y <- c (4, 5, 6) f <- data.frame (X = x,Y = y) f $ X |