I have trouble with dynamic variable that I want to use in quantile function.
I tried to use paste0 for column name, that I want to use:
m = "01"
quantile_s = data %>%
group_by(col1, col2) %>%
summarise(quant1 = quantile(data[[paste0("col3_", m)]], prob=0.75, type=2, na.rm = TRUE)
But in the result, instead of the right answer, it returns the same value in every observation...
Can someone help me?