I think I've stumbled apon my first error with a spelling mistake.
I am running the following code with R and dplyr.
> foobar = c(1,2,3)
> foobar %>% as.character
[1] "1" "2" "3"
This works fine, now I try to run it through an anonymous function.
> foobar %>% function(x) x * 2
Error: Anonymous functions myst be parenthesized
Any idea what is happening? (And where I need to ping to get 'myst' corrected to 'must')?
The error message is quite informative (even if one word is misspelled). Put parentheses around the anonymous function.
For explanation, see the Using %>% with call- or function-producing rhs section in
It has nothing to do with
dplyr
. As for the typo in the error message, whenever you find something that might need attention you can contact the package maintainer. Although it seems this has been fixed in the most recent development version ofmagrittr
. An easy way to find the maintainer of a package is to useThe result is omitted here because it contains an email address.