Skip to content

Commit 927157a

Browse files
Include {data.table} example in redundant_equals_linter() docs (#2659)
1 parent 427fab3 commit 927157a

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

R/redundant_equals_linter.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
#' linters = redundant_equals_linter()
2020
#' )
2121
#'
22+
#' lint(
23+
#' text = "dt[is_tall == FALSE, y]",
24+
#' linters = redundant_equals_linter()
25+
#' )
26+
#'
2227
#' # okay
2328
#' lint(
2429
#' text = "if (any(x)) 1",
@@ -30,6 +35,12 @@
3035
#' linters = redundant_equals_linter()
3136
#' )
3237
#'
38+
#' # in `{data.table}` semantics, `dt[x]` is a join, `dt[(x)]` is a subset
39+
#' lint(
40+
#' text = "dt[(!is_tall), y]",
41+
#' linters = redundant_equals_linter()
42+
#' )
43+
#'
3344
#' @evalRd rd_tags("redundant_equals_linter")
3445
#' @seealso
3546
#' - [linters] for a complete list of linters available in lintr.

man/redundant_equals_linter.Rd

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)