here are the raw ingredients for the type of thing you are asking about doing.
library(tidyverse)
(example_df <- tibble(c1=c("a a",letters[1:4]),
c2=c(letters[4:1],"a a a")))
(interim_df <- mutate(example_df,
across(c(c1,c2),
~str_count(.x,"a"))) )
(summary_df <- summarise(interim_df,
across(c(c1,c2),
sum)))