Creating new columns based on selected columns that calculates the ratio by group
问题 My data looks as follows: DF <- structure(list(No_Adjusted_Gross_Income = structure(c(1L, 1L, 2L, 2L, 3L, 3L), .Label = c("A", "B", "C"), class = "factor"), NoR_from_1_to_5000 = c(1035373, 4272260, 1124098, 1035373, 4272260, 1124098), NoR_from_5000_to_10000 = c(319540, 4826042, 1959866, 319540, 4826042, 1959866), AGI_from_1_to_5000 = c(2588950186.5, 10682786130, 2810807049, 2588950186.5, 10682786130, 2810807049 ), AGI_from_5000_to_10000 = c(2396550000, 36195315000, 14698995000, 2396550000,