I am wondering of how can I loop the multiple variables at the same time in R.
For example,
a = c(1, 2, 3)
b = c(4, 5, 6)
And then for loop, the below code didnt work.
for (i, j in a, b) {
print(i)
print(j)
}
In Python,
for i,j in zip(a,b):
print(i)
print(j)
it is possible. How can I do this in R?