Attached data :
<code>id = c (2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2)
vm = c("12", "13", "14", "15", "16", "17", "18" "19", "20", "21", "22", "23", "24")
GE = c("0", "0", "0", "0", "0" "0", "1", "0", "1", "0", "1","0", "1")
status = c("noinfection", "noinfection", "noinfection", "noinfection", "noinfection", "noinfection", "infection", "noinfection", "infection", "noinfection", "infection", "noinfection", "infection")
fichier <- data.frame(id, vm, GE, status)
</code>
<code>id = c (2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2)
vm = c("12", "13", "14", "15", "16", "17", "18" "19", "20", "21", "22", "23", "24")
GE = c("0", "0", "0", "0", "0" "0", "1", "0", "1", "0", "1","0", "1")
status = c("noinfection", "noinfection", "noinfection", "noinfection", "noinfection", "noinfection", "infection", "noinfection", "infection", "noinfection", "infection", "noinfection", "infection")
fichier <- data.frame(id, vm, GE, status)
</code>
id = c (2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2)
vm = c("12", "13", "14", "15", "16", "17", "18" "19", "20", "21", "22", "23", "24")
GE = c("0", "0", "0", "0", "0" "0", "1", "0", "1", "0", "1","0", "1")
status = c("noinfection", "noinfection", "noinfection", "noinfection", "noinfection", "noinfection", "infection", "noinfection", "infection", "noinfection", "infection", "noinfection", "infection")
fichier <- data.frame(id, vm, GE, status)
I would like to be able to modify the value of the status variable at vm = 18 and vm = 24.
a) At vm = 18
– the value 0 if GE = 0 during the previous visits of 13 to 17.
– the value 1 if GE = 1 during the previous visits of 13 to 17.
b) At vm = 24
– the value 0 if GE = 0 during the previous visits of 19 to 23.
– the value 1 if GE = 1 during the previous visits of 19 to 23.