I have a series of variables with the variable names "HPV_x_ALL". The only difference between these names is the x, which is number (e.g., 11, 16, 18, 33). I'd like to use -rowSums- to summarize the values of HPV_x_ALL for each observation, and I tried using * to represent the numbers, but it doesn't work. Thank you!
Update: Hi, I added a reproducible dataset.
structure(list(HPV_16_ALL = c(1L, NA, 0L, 0L, 0L, 0L), HPV_18_ALL = c(0L,
NA, 0L, 0L, 0L, 0L), HPV_33_ALL = c(0L, NA, 0L, 0L, 0L, 0L)), row.names = 40:45, class = "data.frame")