I have a data frame like this:
df <- data.frame(quadrant = rep(2:3, each = 3, times = 1),
ICD = c("S06|D11|A41|O34|O48",
"R55|A08|K40",
"N23|F13|K80|F19",
"R13|C18",
"E13|F19",
"D11|A41|N23|K80"))
I want to split up the string variable, generate a new row for each ICD while repeating the quadrant identifier.
Does somebody know a way how to handle this via dplyr::mutate
?