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

Better documentation for pmap + formula incompatibility #289

Closed
tiernanmartin opened this issue Feb 28, 2017 · 6 comments
Closed

Better documentation for pmap + formula incompatibility #289

tiernanmartin opened this issue Feb 28, 2017 · 6 comments
Labels

Comments

@tiernanmartin
Copy link

@tiernanmartin tiernanmartin commented Feb 28, 2017

While pmap accepts anonymous functions in .f just like the other map*s, it doesn't allow users to make use of formulas (~).

I spent a while (probably too long) trying to glean this from ?map2, only to eventually find the answer here.

Please consider making this incompatibility explicit in the documentation - thanks!

@lionel-
Copy link
Member

@lionel- lionel- commented Mar 1, 2017

@hadley I still think it would be elegant to support positional ..1, ..2, ..3 etc in anonymous functions for these cases ;)

Loading

@hadley
Copy link
Member

@hadley hadley commented Mar 1, 2017

That seems reasonable. Would the numeric suffixes work everywhere? (so you'd have the choice between ., .x, and ..1? Maybe it should just be .1 for consistency?

Loading

@lionel-
Copy link
Member

@lionel- lionel- commented Mar 1, 2017

Yes it would work everywhere. The ..1 approach has an elegant implementation: #63

Loading

@lionel-
Copy link
Member

@lionel- lionel- commented Mar 1, 2017

though of course I now find the use of lazyeval::interp() disgraceful. But the following works :)

function(..., . = ..1, .x = ..1, .y = ..2)

Loading

@hadley
Copy link
Member

@hadley hadley commented Mar 1, 2017

Yeah, let's take a look again when you're working on purrr

Loading

@lionel-
Copy link
Member

@lionel- lionel- commented Mar 1, 2017

this is now rlang territory, I'll send a PR.

Loading

@hadley hadley added the feature label Mar 3, 2017
@hadley hadley closed this in 084dde2 Mar 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants