When a matrix is indexed like A[:4,], it returns four values (0..3)
It is confusing that the same does not apply to for loop ranges,
for (i in 0:4) iterates five times/ five values 0..4
a single iteration needs for (i in 0:0) which is unintuitive
A = as.matrix([0,1,2,3,4,5,6]);
print(transpose(A[:4,]));
for (i in 0:4) {
print(A[i,]);
}
When a matrix is indexed like A[:4,], it returns four values (0..3)
It is confusing that the same does not apply to for loop ranges,
for (i in 0:4)
iterates five times/ five values 0..4 a single iteration needsfor (i in 0:0)
which is unintuitive