You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vignettes/formatR.Rmd
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -273,10 +273,10 @@ will become
273
273
Inline comments are first disguised as a weird operation with its preceding R code, which is essentially meaningless but syntactically correct! For example,
274
274
275
275
```r
276
-
1+1 %InLiNe_IdEnTiFiEr% "# comments"
276
+
1+1 %\b% "# comments"
277
277
```
278
278
279
-
then `base::parse()` will deal with this expression; again, the disguised comments will not be removed. In the end, inline comments will be freed as well (remove the operator `%InLiNe_IdEnTiFiEr%` and surrounding double quotes).
279
+
then `base::parse()` will deal with this expression; again, the disguised comments will not be removed. In the end, inline comments will be freed as well (remove the operator `%\b%` and surrounding double quotes).
280
280
281
281
All these special treatments to comments are due to the fact that `base::parse()` and `base::deparse()` can tidy the R code at the price of dropping all the comments.
282
282
@@ -290,6 +290,8 @@ There are global options which can override some arguments in `tidy_source()`:
Also note that single lines of long comments will be wrapped into shorter ones automatically, but roxygen comments will not be wrapped (i.e., comments that begin with `#'`).
297
+
Also note that single lines of long comments will be wrapped into shorter ones automatically when `wrap = TRUE`, but roxygen comments will not be wrapped (i.e., comments that begin with `#'`).
0 commit comments