for loop in r 0 to 10 code example Example: for in r for (val in x) { if(val %% 2 == 0) count = count+1 }