sweep

Sweeping through data in R

How do you apply one particular row of your data to all other rows? Today I came across a data set which showed the revenue split by product and location. The data was formated to show only the split by product for each location and the overall split by location, similar to the example in the table below. Revenue by product and continent Africa America Asia Australia Europe A 40% 30% 50% 40% 40% B 20% 40% 20% 30% 40% C 40% 30% 30% 30% 20% Total 10% 40% 20% 10% 20% I wanted to understand the revenue split by product and location.