I'm still having problems calculating numbers.
Trying to find the amount of numbers inside [-0.5 , 0.5] the first line, and the amount of numbers outside the same range in the second line.
I use abc = rnorm(100, mean=0, sd=1)
. So I have 100 numbers in total, but i only have 35 numbers inside the range, and 35 outside the range, that dosen't add up to 100.
length(abc[abc>=-0.5 & abc<=0.5])
[1] 35
length(abc[abc<-0.5 & abc>0.5])
[1] 35
Then I tried:
length(which(abc>=-0.5 & abc<=0.5))
[1] 40
length(which(abc<-0.5 & abc>0.5))
[1] 26
And it still doesn't add up to 100. What's wrong?