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

pmap output names help file #1124

Closed
ggrothendieck opened this issue Apr 12, 2024 · 1 comment · Fixed by #1143
Closed

pmap output names help file #1124

ggrothendieck opened this issue Apr 12, 2024 · 1 comment · Fixed by #1143
Labels
documentation tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day

Comments

@ggrothendieck
Copy link

ggrothendieck commented Apr 12, 2024

The help file for pmap says

The output names are determined by the input names.

but the names of BOD are c("Time", "demand") and the output has no names. There were some SO posts guessing that it means the names of the first column of the input (https://stackoverflow.com/questions/78310377/name-output-of-pmap-on-tibble/78310769#78310769) or the first column with names in the input (https://stackoverflow.com/questions/78314849/naming-of-elements-in-purrrmap). Please clarify.

str(pmap(BOD, ~ .x + .y))
## List of 6
## $ : num 9.3
## $ : num 12.3
## $ : num 22
## $ : num 20
## $ : num 20.6
## $ : num 26.8
@hadley hadley added documentation tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day labels Jul 15, 2024
@hadley
Copy link
Member

hadley commented Jul 15, 2024

Looking at the source code, yes, the names come from names of the first element.

SoyAndrea added a commit to SoyAndrea/purrr that referenced this issue Aug 15, 2024
@hadley hadley closed this as completed in 06f5098 Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation tidy-dev-day 🤓 Tidyverse Developer Day rstd.io/tidy-dev-day
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants