Function calls where a braced expression is present in the last argument deserves a call out, as it is a special function call style (i.e. not exactly flat or expanded)
map(xs, function(x) {
do_something(x)
})
map(xs, \(x) {
do_something(x)
})
test_that("description", {
test_me
})
These make for particularly unique function call layouts, because normally the expansion of the braced expression over multiple lines would force the expansion of every argument in the function call, looking like:
map(
xs,
function(x) {
do_something(x)
}
)
map(
xs,
\(x) {
do_something(x)
}
)
test_that(
"description",
{
test_me
}
)
Note that this only applies to trailing braced expressions, for example with tryCatch() we do full expansion of every argument
tryCatch(
{
expr
},
error = function(e) {}
)
Function calls where a braced expression is present in the last argument deserves a call out, as it is a special function call style (i.e. not exactly flat or expanded)
These make for particularly unique function call layouts, because normally the expansion of the braced expression over multiple lines would force the expansion of every argument in the function call, looking like:
Note that this only applies to trailing braced expressions, for example with
tryCatch()we do full expansion of every argumenttryCatch( { expr }, error = function(e) {} )