I have data frame like this:
Port Type
1 Port1 ssh
2 Port1 ftp
3 Port2 http
4 Port1 http
5 Port2 ssh
6 Port3 ssh
7 Port3 https
8 Port4 http
9 Port2 ftp
10 Port3 ssh
11 Port3 ftp
12 Port4 ssh
I want to have a sum like this:
Port ssh ftp http https
Port1 1 1 1 0
Port2 1 1 1 0
Port3 2 1 0 1
Port4 1 0 0 1
I chose R because there are some other columns with numeric values, I could use R to compute mean/median/quantile quite conveniently. I searched and found this: Sum of rows based on column value, however the code there seems to be working only on numeric element.
Thanks a lot for the answer.