Re-use the placeholder for attributes
mainYou can use the . placeholder multiple times in a right-hand side expression.
Important Behavior: If the placeholder only appears inside nested expressions, magrittr applies the 'first-argument rule' (automatically passing the LHS to the first argument of the first function). To force the use of the placeholder for specific arguments in nested expressions, enclose the right-hand side in braces {}.
x %>% f(y = nrow(.), z = ncol(.))is equivalent tof(x, y = nrow(x), z = ncol(x))(due to the first-argument rule).x %>% {f(y = nrow(.), z = ncol(.))}is equivalent tof(y = nrow(x), z = ncol(x))(overruling the rule with braces).
x %>% {f(y = nrow(.), z = ncol(.))}