'How to combine matrixes

I'm a complete beginner so please bear with me!

I have data that looks like this:

Id Test 1 Test 2 Test 3
1 ok ok ko
2 ok ko ko
3 ok ok ok
4 ko ko ko
5 ok ko ko

I would like a table that count every "ok" and "ko", test by test so ideally, I would get something like this:

test 1 test 2 test 3
ok 4 3 1
ko 1 2 4

I could just do 3 simple matrix with "test 1" as a row and "count of test 1" as values but I'm sure there's an easy way to combine them as one table, I just can't figure it out.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source