r’s vector indexing is confusing