Here is some sample data:
df1 <- read.table(text = "Date Client1 Client2 Client3
01.01.2019 0 0 2
01.02.2019 0 0 3
01.03.2019 0 0 4
01.04.2019 0 0 4
01.05.2019 0 0 4
01.06.2019 1 0 4
01.07.2019 0 0 0
01.08.2019 0 0 1
01.09.2019 0 0 0
01.10.2019 0 3 0
01.11.2019 0 0 2
01.12.2019 2 0 0
01.01.2020 3 4 3
01.02.2020 4 0 3
01.03.2020 5 0 0
01.04.2020 5 0 0
", header = TRUE)
df1[df1 == 0] <- NA
And the question is how to find a logical index for every column that contains a sequence of 5 or more rows that doesn't contains NAs.
Client1 TRUE
Client2 FALSE
Client3 TRUE