Complement of empty index vector is empty index vector
I am removing values from a vector by using - (minus sign) in front of the index vector. Like this:
scores <- scores[-indexes.to.delete]
indexes.to.delete vector is empty, that is N/A. So the
scores vector should then remain unchanged. However, I am getting empty
scores vector when
indexes.to.delete is empty.
I could code an if statement checking whether
indexes.to.delete is empty, but I am wondering if there is a simpler way?