I have the following dataframe df
structure(list(Names = c("James", "Diana", "Dr. Michel", "Mr. George", "Hello world", "Janis","JJK"), code = c("xx34-2111", "7789-2869", "dg67-5555", "1555-2uuy", "fhgj-2jj8", "2199-7kk8","1111-1111"), `13/A1` = c(NA, "‡(2017)", NA, "‡(2017)", "A",
"A(2019)", "A(2016)"), `13/A2` = c(NA, "‡(2017)", NA, "‡(2017)",
"A", "A(2019)", "A(2016)"), `13/A3` = c(NA, "‡(2017)", NA, "‡(2017)",
"A", "A(2019)", "A(2016)"), `13/A4` = c(NA, "‡(2017)", NA, "‡(2017)",
"A", "A(2019)", "A(2016)"), `13/A5` = c(NA, "‡(2017)", NA, "‡(2017)",
"A", "A(2019)", "A(2016)"), `13/B1` = c("A", "A", "A(2017)",
"‡(2017)", "A", "A(2019)", NA), `13/B2` = c("A", "A", "A(2017)",
"‡(2017)", "A", "A(2019)", NA), `13/B3` = c("A", "A", "A(2017)",
"‡(2017)", "A", "A(2019)", NA), `13/B4` = c("A", "A", "A(2017)",
"‡(2017)", "A", "A(2019)", NA), `13/B5` = c("A", "A", "A(2017)",
"‡(2017)", "A", "A(2019)", NA), `13/C1` = c(NA, "A", NA, "‡(2017)",
"A", "A(2019)", NA), `13/D1` = c(NA, "‡(2017)", NA, "‡(2017)",
NA, "A", NA), `13/D2` = c(NA, "‡(2017)", NA, "‡(2017)", NA, "A",
NA), `13/D3` = c(NA, "‡(2017)", NA, "‡(2017)", NA, "A", "A(2017)"
), `13/D4` = c("A", "‡(2017)", NA, "‡(2017)", NA, "A", NA)), row.names = c(1L,
6L, 11L, 39L, 101L, 483L, 667L), class = "data.frame")
I would like to keep only the rows of df which contain in at least one of the columns 3:17, any of the following entries: A, A(2016), A(2017), A(2019).
For the example above, this means to delete only the row containing Mr. George in the field Names.
My attempt
df[,3:17]%in% c("A","A(2016)","A(2017)","A(2019)")
does not give the desired result.