Consider this vector:
x <- c("A", "B", "C", "D")
When we do a normal slice,
x <- x[2:4]
It returns:
"B" "C" "D"
Why is it that when we perform this line of code, NA is returned?
x[1+1:4]
"B" "C" "D" NA
However when we put a parenthesis around the plus sign,
x[(1+1):4]
[1] "B" "C" "D"
It returns the correct output.