My data:
data <- data.frame(column1 = c("A","B","C","D"), column2 = c(4, NA, NA, 1))
My pipe:
library (dplyr)
data2 <- data %>%
filter (grepl("A|B|D", column1))
My question: How can I (simply) continue my pipe to add a row containing the total of the column2 (total = 5)?