I would like to create a variable x
that is just the values of V1, which correspond to Sunday, that is, the variable x will only contain: 0,1,0,0,5,0,1,0,0,9,4.
df <- structure(
list(date = c("01-08-2021","01-08-2021","01-08-2021","01-08-2021","01-08-2021",
"08-08-2021","08-08-2021","08-08-2021","08-08-2021","08-08-2021","08-08-2021",
"13-08-2021","13-08-2021","13-08-2021","13-08-2021","13-08-2021"),
Week= c("Sunday","Sunday","Sunday","Sunday","Sunday","Sunday","Sunday","Sunday",
"Sunday","Sunday","Sunday","Friday","Friday","Friday","Friday","Friday"),
V1 = c(0,1,0,0,5,0,1,0,0,9,4,3,4,5,6,7), V2 = c(2,0,0,6,9,2,0,0,7,8,1,3,5,6,4,3)),
class = "data.frame", row.names = c(NA, -16L))