Skip to content

Commit

Permalink
Clarify parens spacing
Browse files Browse the repository at this point in the history
Fixes #66
  • Loading branch information
hadley committed Jun 26, 2018
1 parent 9ea5ef5 commit bde1f15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 02-syntax.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ tribble(
)
```

Place a space before `(`, except when it's part of a function call.
Place a space before `(` when its used with a keyword like `if`, `for` or `function`:

```{r, eval = FALSE}
# Good
if (debug) show(x)
plot(x, y)
plot((x + y) ^ 2, (x - y) ^ 2)
# Bad
if(debug)show(x)
plot (x, y)
plot ( (x + y) ^ 2, (x - y) ^ 2)
```

Extra spacing (i.e., more than one space in a row) is ok if it improves
Expand Down

0 comments on commit bde1f15

Please sign in to comment.