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

Comments

Projects
None yet
3 participants
@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

This comment has been minimized.

Show comment
Hide comment
@edlee123

edlee123 Jul 3, 2016

Contributor

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)
  ^
> 
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@yihui

yihui Jul 7, 2016

Owner

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

Owner

yihui commented Jul 7, 2016

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

@edlee123 edlee123 referenced this issue May 7, 2017

Open

Magrittr wrap #68

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