create an array of number in R
Code snippet on how to create an array of number in R
numbers <- c(1,2,3,4,5)
This code creates an array of numbers in R. First, the variable “numbers” is declared at the left of the equal sign. At the right of the equal sign is the function used to create the array, c(). Inside the parentheses are the values to be included in the array, in this case five numbers: 1, 2, 3, 4, 5. The array is now stored in the “numbers” variable, and can be manipulated as such.