I know this question was already posted but the answer was a trick to solve the given problem some other way, but the core question remained unanswered.
The question is this.
somevector <- 1:5
emptyindeces <- vector()
somevector[-emptyindeces] #returns empty vector
Why it is not the original vector?
Is there a reason for that or am I understanding it wrong. If so whats the correct way to get the complement of an index vector.