/ (max(df$b) - min(df$b)) (df$c - min(df$c)) / (max(df$c) - min(df$c)) (df$d - min(df$d)) / (max(df$d) - min(df$d)) Rule of three: make a function if you’ve copy-pasted threes times
%>% summarise(mean = mean(y2)) df %>% group_by(x3) %>% summarise(mean = mean(y3)) df %>% group_by(x4) %>% summarise(mean = mean(y4)) Then identify the parts that could change
show_query() #> SELECT `mpg`, `cyl`, `disp`, `hp` #> FROM `mtcars` #> WHERE (`cyl` > 2.0) #> LIMIT 10 And makes it possible to translate to other languages
trees with unquoting Quote to capture code + env enquo() Learn more https://adv-r.hadley.nz/expressions.html https://adv-r.hadley.nz/quasiquotation.html https://adv-r.hadley.nz/evaluation.html WIP 2nd ed