It would be nice to allow a trailing comma in commands like the example below. That would make it easier to rearrange the order or to comment out lines without needing to figure out whether the commas need adjusting.
diamonds %>%
group_by(color, clarity) %>%
summarise(
depth = mean(depth),
price = mean(price),
carat = mean(carat), # <-- trailing comma here currently causes errors
)
I'm imaging a function that could be called at the top of a function definition that would gobble this empty argument. Or perhaps a wrapper function a la Vectorize() that could be used to convert any function into a function with this behavior. Seems like this could be useful for many functions both within dplyr and elsewhere.
It would be nice to allow a trailing comma in commands like the example below. That would make it easier to rearrange the order or to comment out lines without needing to figure out whether the commas need adjusting.
I'm imaging a function that could be called at the top of a function definition that would gobble this empty argument. Or perhaps a wrapper function a la
Vectorize()that could be used to convert any function into a function with this behavior. Seems like this could be useful for many functions both withindplyrand elsewhere.