To remove an element from the beginning of a one-dimensional array in R, you can use array indexing to subset the array, excluding the first element. Here's an example:
main.r167 chars9 lines
In this example, we create an array my_array
with values 1 through 5, and then remove the first element using array indexing. The resulting array my_array
now contains only the elements 2 through 5.
gistlibby LogSnag