glue icon indicating copy to clipboard operation
glue copied to clipboard

`glue_data()` documentation should mention that named arguments take precedence over `.x`

Open pnacht opened this issue 2 years ago • 0 comments

glue_data() currently gives priority to named arguments over elements of .x.

glue::glue_data("SELECT {x}", .x = list(x = 1), x = 2)
#> "SELECT 2"

This seems perfectly reasonable: if your query includes a value you went to the trouble of setting as a named argument, that value should probably take precedence over a possibly unexpected similar name in .x.

However, this behavior should probably be made clear in the documentation.

pnacht avatar Feb 25 '22 19:02 pnacht