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

Comments

@tiernanmartin
Copy link

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-

This comment has been minimized.

Copy link
Member

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 ;)

@hadley

This comment has been minimized.

Copy link
Member

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?

@lionel-

This comment has been minimized.

Copy link
Member

commented Mar 1, 2017

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

@lionel-

This comment has been minimized.

Copy link
Member

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)
@hadley

This comment has been minimized.

Copy link
Member

commented Mar 1, 2017

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

@lionel-

This comment has been minimized.

Copy link
Member

commented Mar 1, 2017

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

@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
Projects
None yet
3 participants
You can’t perform that action at this time.