0

I want to recreate the table of observed frequencies below in R as a data frame first and a table after as I want to manipulate the values after. The total column and row are just for completeness. Can someone help me do this?

My expected output with Group Indicator and Result Indicator as column names:

                 Result Indicator
  Group indicator Stroke No Stroke Total
  Aspirin group      300       400   700
  Placebo group      360       450   810
  Total              660       850  1510
Red
  • 47
  • 5
  • Please provide a reproducible example along with expected output. Read about [how to give a reproducible example](http://stackoverflow.com/questions/5963269). – Ronak Shah Dec 04 '20 at 03:32
  • https://stackoverflow.com/questions/4946873/add-row-to-a-data-frame-with-total-sum-for-each-column – Ronak Shah Dec 04 '20 at 03:39
  • `my_df <- data.frame( group = c("aspirin", "placebo"), stroke=c(300, 360), nostroke = c(400, 450))` – DanY Dec 04 '20 at 04:24

0 Answers0