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

Curly braces inside function prototype gets broken into new lines by tidy_source() #43

Closed
rsaporta opened this issue Feb 10, 2015 · 1 comment

Comments

@rsaporta
Copy link

Not sure if this is intended behavior or not. Would it be possible for the user to control this behavior (ie turn it off if undesired)?

exampleFunc <- function(x, y={if (x > 5) -1 else NA}, z=0) {
  print ("hello World")
}

   vvvvv tidy_source() vvvvvvvv

exampleFunc <- function(x, y = {
    if (x > 5)
        -1 else NA
}, z = 0) {
    print("hello World")
}
@yihui
Copy link
Owner

yihui commented Feb 11, 2015

Sorry, but I do not think there is a way to turn it off. In this particular case, I do not see why the curly braces are necessary, i.e.

exampleFunc <- function(x, y=if (x > 5) -1 else NA, z=0) {
  print ("hello World")
}

@yihui yihui closed this as completed Aug 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants