R and for loop code example
Example 1: r for loop
for (val in sequence)
{
statement
}
Example 2: for in r
for (val in x) {
if(val %% 2 == 0) count = count+1
}
for (val in sequence)
{
statement
}
for (val in x) {
if(val %% 2 == 0) count = count+1
}