I am beginner in R so when I tried to make a for loop by sequence it gave me the expected result for one vector but for the second one, it gave me the same value along the v