I have this code
x=c(T,T,F,T,F)
for (i in 1:5){
if(i > 1 & i < 5){
x[i ] = x[i-1] & x[i+1] & x[i]
print(x)
}
else if(i < 5){
x[i] = !x[i] | !x[i+1]
}
}
I am trying to figure out the output it gives me
[1] FALSE FALSE FALSE TRUE FALSE
[1] FALSE FALSE FALSE TRUE FALSE
[1] FALSE FALSE FALSE FALSE FALSE
I am wondering if the first value x[2]
(which is x[2] = T & F & T
) will influence the output of the next line x[3]
or if these calculations for each line are independent of each other?