## Calculating shares by row in R using data.table

In R, it often happens that I need to calculate the share of each column by row. In this very simple example I would like to update the following table: apples oranges bananas pineapples 2 4 6 3 1 0 9 2 5 1 2 3 and I would like…