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
feature a feature request or enhancement

Comments

@tiernanmartin
Copy link

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- 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
Copy link
Member

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?

@lionel-
Copy link
Member

lionel- commented Mar 1, 2017

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

@lionel-
Copy link
Member

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)

@hadley
Copy link
Member

hadley commented Mar 1, 2017

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

@lionel-
Copy link
Member

lionel- commented Mar 1, 2017

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

@hadley hadley added the feature a feature request or enhancement label Mar 3, 2017
@hadley hadley closed this as completed in 084dde2 Mar 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants