klutometis/roxygen — pull request #287 by jimhester (2014-09-30 16:49:40+00:00)
Title: Use %==% to check for identical equality

This improves safety and correctness over using == for testing 1 to 1
equality.

As you probably know, `==` has issues when the arguments are not as you were expecting.
i.e.
```r
if(names(1) == 'val') { print('val') }
# Error in if (names(1) == "val") { : argument is of length zero

if(c(1,2) == 'val') { print('val') }
#Warning message:
#In if (c(1, 2) == "val") { :
# the condition has length > 1 and only the first element will be used
#logical(0)
```

Using `%==%`, which is just an alias for `identical()` does the correct thing in these cases while maintaining readability of the expression.

```r
if(names(1) %==% 'val') { print('val') }
if(c(1,2) %==% 'val') { print('val') }
```

I thought `roxygen` could use some more robustness in this regard. So I went through and replaced all the one to one comparisons that were previously using `==` with `%==%`. All the tests pass on my machine, so there should not be any user visible change.