I have a table with twenty columns and thousands of rows.
Just for example purposes, I will say I have this table:
ColumnA ColumnB
Testing This
1231 1231
I want to count how many times each single character appears in the whole dataset.
So in our toy example we would have
character nºoftimes
T 3
e 1
s 2
i 2
n 1
g 1
h 1
1 4
2 2
3 2
I was thinking of using some kind of string manipulation, but now sure how can I do this.
>Solution :
Does this work:
data.frame(table(strsplit(toupper(paste0(apply(df, 2, paste0, collapse = ''), collapse = '')), split = '')))
Var1 Freq
1 1 4
2 2 2
3 3 2
4 E 1
5 G 1
6 H 1
7 I 2
8 N 1
9 S 2
10 T 3