I have a vector in R and would like to select all elements in the vector between two positions.
I know I can achieve this through by stating the location of the elements within the list using the example below.
test <- c('Group1', 'Test', 'sample', 'abcd', '1234', 'ghsnd', 'asdcd')
test[c(2:6)]
I would instead like to do this by calling the name of the elements in the list. For example calling 'Test':'ghsnd'.