I was trying to run this simple code in R and that's what I got:
table <- matrix(NA, nrow=10, ncol=1)
for (i in seq(0.01, 0.10, by=0.01)) {
table[i*100, ] <- i
}
table
# [,1]
# [1,] 0.01
# [2,] 0.02
# [3,] 0.03
# [4,] 0.04
# [5,] 0.05
# [6,] 0.07
# [7,] NA
# [8,] 0.08
# [9,] 0.09
#[10,] 0.10
If I run my code backwards, it works fine:
table <- matrix(NA, nrow=10, ncol=1)
for (i in seq(0.1, 0.01, by=-0.01)) {
table[i*100, ] <- i
}
table
# [,1]
# [1,] 0.01
# [2,] 0.02
# [3,] 0.03
# [4,] 0.04
# [5,] 0.05
# [6,] 0.06
# [7,] 0.07
# [8,] 0.08
# [9,] 0.09
#[10,] 0.10
Does anyone know what's going on?
I'm using R version 3.2.0 on Mac.