I was making some code for a statistics class and when I was trying to sum the elements in a vector the answer was wrong. I was adding the elements in a data vector minus their mean, the output should be zero but R returns 8.12312e-14 (near to zero), this is the code:
X <- c(40, 62, 69, 77, 83, 88, 94, 101, 109, 115,
123, 125, 128, 136, 137, 152, 152, 153, 160, 165)
sum(X-mean(X))
Actually I am new in R so I don't know what to try