We can use filter with across library(dplyr) library(tidyr) library(stringr) library(purrr) df %>% select(-1) %>% mutate(across(everything(), as.character)) %>% filter(across(everything(), ~ str_detect(.,...
@Ronak and @akrun above beat me to the punch, my solution is very similar - with an extension if you...
You can get the string value with grep and count them using table : stack(table(grep('[[:alpha:]]', unlist(df), value = TRUE)))[2:1] If...
This rather poorly documented, but one argument to layer function is the key_glyph argument which can specify what sort of...
Based on the answer from Allan, I have enhanced the function so that background color of the keys are now...
You can also do this using lower level grid function to edit the relevant grobs. If p is the plot...
This is one way of doing it, but it's a bit convoluted (based on this excellent post): # Some data...
I don't think there's a way to send multiple colors to legend.background. If this is really important to you, then...