У меня есть датафрейм. Есть ли способ для общего столбца. Например
>df <-
structure(list(Product = structure(c(2L, 1L, 3L), .Label = c("Product 100",
"Product 75", "Product 87"), class = "factor"), Product.Family = structure(c(1L,
2L, 2L), .Label = c("Product.Family 43", "Product.Family 48"), class = "factor"),
ColA = structure(1:3, .Label = c("A", "B", "C"), class = "factor")), class = "data.frame", row.names = c(NA,
-3L))
Product 75 Product 100 Product 87
Product Family 43 100 0 0
Product Family 48 0 50 50
I need it in terms of percentage