Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request for argument synchronization with dplyr #1497

Closed
jmgirard opened this issue Jun 4, 2023 · 4 comments
Closed

Request for argument synchronization with dplyr #1497

jmgirard opened this issue Jun 4, 2023 · 4 comments

Comments

@jmgirard
Copy link

jmgirard commented Jun 4, 2023

I do a lot of teaching with tidyverse tools and one thing that is not ideal is that some arguments are different across tidyverse packages. For example, I teach about how to combine tibbles using dplyr::bind_rows() and the .id argument. Then I introduce the idea of giving a vector of file names to readr::read_csv() to do the same kind of thing from data files. This is great but then I have to tell the students that the argument here is id not .id. It would be very helpful if arguments like this could be synchronized across core tidyverse packages.

@jmgirard
Copy link
Author

jmgirard commented Jun 4, 2023

I guess you could argue that dplyr::bind_rows(.id) and readr::read_csv(id) do slightly different things (e.g., add a positional index or argument name for the former and add the file name for the latter) and therefore should have different names. But by that logic, the argument names should probably be even more different than the inclusion or exclusion of a leading period. So either way, it might be good to take a look at this.

@hadley
Copy link
Member

hadley commented Jul 31, 2023

Our justification for the different names can be found at https://design.tidyverse.org/dots-prefix.html.

@hadley hadley closed this as completed Jul 31, 2023
@jmgirard
Copy link
Author

Our justification for the different names can be found at https://design.tidyverse.org/dots-prefix.html.

For posterity: Based on my reading of that link, they are different because bind_rows() uses ... to create a data structure, whereas read_csv() does not. The tidy design guide says to add . before an argument name in the former case only.

@hadley
Copy link
Member

hadley commented Jul 31, 2023

Exactly!

We don't want to accidentally interfere if you are trying to do bind_rows(id = id, ego = ego) and it would be weird for read_csv() to have a single argument starting with a ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants