I have a data frame that looks like this:
gender <- c("F", "M", "M", "M", "M")
entourage <- c("YC; AD; EL", "YC", "AD; YC", "AD", "EL")
data <- data.frame(gender, entourage)
I want to plot the number of times substrings "YC", "AD", and "EL" occur in ggplot. I also want to plot the count of "YC" given that gender is "M".