df_test2<-data.frame(test1=c("in","out"),
test2=c(1:2))
> df_test2
test1 test2
1 in 1
2 out 2
for (i in df_test2$test1){
for (j in df_test2$test2){
if(i="in"){
print(j+1)
}else{
print(j-1)
}
}
I ran the above code and nothing returned while I was expecting see the outcome being 2 and 1. Mind telling if I am using the wrong loop technique? Many thanks.