DATA
I have a dataset similar to the dummy one below.
CODE
library(dplyr)
set.seed(111)
data <- tibble(ID = sort(sample(LETTERS, 10, F)),
A = round(rnorm(10, 4, 1), 1),
B = sample(0:20, 10, F),
C = rep(c(33, 9), each = 5))
data <- rbind(data, c("ratio", 0.7, 0.25, 0.05))
QUESTION
I want to produce a new dataframe where each row is multiplied by the row called ratio (excluding first column with IDs). The ratio row can be then removed from the output table.
Is there a simple way of doing this in dplyr?