给定一个包含字符串的列的数据框。我想绘制具有某种模式的字符串的频率。例如
strings <- c("abcd","defd","hfjfjcd","kgjgcdjrye","yryriiir","twtettecd")
df <- as.data.frame(strings)
df
strings
1 abcd
2 defd
3 hfjfjcd
4 kgjgcdjrye
5 yryriiir
6 twtettec
我想绘制包含模式“cd”的字符串的频率任何人有一个快速的解决方案?