Lets say i have a string which I split.
x<- 'A,B,C,D'
x<-unlist(strsplit(x, ","))
And lets say I have this data which I store in a variable called y.
I want to count each element of x in each column of y. For example, I would count the number of A in the first column, the number of B in the first column, the number of C in the first column, number of D in the first column. I would do this for each column. How is that possible? I am a very beginner to R so I am having issues figuring this one out.
This is something I want to use in a shiny app. The user inputs a string which is then split and then it is checked that how many times each element of splitted string occurs in each column.