count_1_k1[i,2] counts the number of transitions from ne to one in row i
##############
count_0_k1 <- matrix(0, dias-1, 2)
count_1_k1 <- matrix(0, dias-1, 2)
for(i in 1:(dias-1)){
for(j in 1:anos){
if((ozonio_sw[i, j] == 0) & (ozonio_sw[i+1,j] == 0))
{count_0_k1[i,1] = count_0_k1[i,1] + 1}
if((ozonio_sw[i, j] == 0) & (ozonio_sw[i+1,j] == 1))
{count_0_k1[i,2] = count_0_k1[i,2] + 1}
if((ozonio_sw[i, j] == 1) & (ozonio_sw[i+1,j] == 0))
{count_1_k1[i,1] = count_1_k1[i,1] + 1}
if((ozonio_sw[i, j] == 1) & (ozonio_sw[i+1,j] == 1))
{count_1_k1[i,2] = count_1_k1[i,2] + 1}}}