Sum by row names

Can you make the example reproducible? It will make it easier to provide an answer.