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

Add support for magrittr #54

Open
g4challenge opened this issue Jun 3, 2016 · 2 comments
Open

Add support for magrittr #54

g4challenge opened this issue Jun 3, 2016 · 2 comments

Comments

@g4challenge
Copy link

@g4challenge g4challenge commented Jun 3, 2016

Please add reformatting for magrittr pipe operator %>%.

For example:
result <- mydata %>% filter(criterion) %>% group_by(mygroup) %>% summarise(summand = sum(count))

should be converted to something like:

mydata %>%
  filter(criterion) %>%
    group_by(mygroup) %>%
      summarise(summand = sum(count)) -> results
@edlee123
Copy link
Contributor

@edlee123 edlee123 commented Jul 3, 2016

Another example:

testfunc = function(){

  testout <- mtcars %>%
    mutate(mpgXcyl = mpg * cyl) %>%
    arrange(desc(disp), hp) %$% 
    carb
  return(testout)
}
> tidy_source()
Error in parse(text = lines, keep.source = TRUE) : 
  <text>:8:0: unexpected end of input
6:     carb
7:   return(testout)
  ^
> 
@yihui
Copy link
Owner

@yihui yihui commented Jul 7, 2016

My reply would be the same as in #53...

yihui added a commit to rbind/yihui that referenced this issue Dec 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.