R: Find and Fix Lints in R Code

# Find and Fix Lints in R Code

## Documentation for package ‘flir’ version 0.5.0

- DESCRIPTION file.
- User guides, package vignettes and other documentation.
- Package NEWS.

## Help Pages

add_new_rule | Create a custom rule for internal use
any_duplicated_linter | Require usage of 'anyDuplicated(x) > 0' over 'any(duplicated(x))'
any_is_na_linter | Require usage of 'anyNA(x)' over 'any(is.na(x))'
class_equals_linter | Block comparison of class with '=='
condition_message_linter | Block usage of 'paste()' and 'paste0()' with messaging functions using '...'
double_assignment_linter | double_assignment
duplicate_argument_linter | Duplicate argument linter
empty_assignment_linter | empty_assignment
equals_na_linter | Equality check with NA linter
equal_assignment_linter | equal_assignment
expect_comparison_linter | Require usage of 'expect_gt(x, y)' over 'expect_true(x > y)' (and similar)
expect_identical_linter | Require usage of 'expect_identical(x, y)' where appropriate
expect_length_linter | Require usage of 'expect_length(x, n)' over 'expect_equal(length(x), n)'
expect_named_linter | Require usage of 'expect_named(x, n)' over 'expect_equal(names(x), n)'
expect_not_linter | Require usage of 'expect_false(x)' over 'expect_true(!x)'
expect_null_linter | Require usage of 'expect_null' for checking 'NULL'
expect_true_false_linter | Require usage of 'expect_true(x)' over 'expect_equal(x, TRUE)'
expect_type_linter | Require usage of 'expect_type(x, type)' over 'expect_equal(typeof(x), type)'
export_new_rule | Create a custom rule for external use
fix | Automatically replace lints
fix_dir | Automatically replace lints
fix_package | Automatically replace lints
fix_text | Automatically replace lints
for_loop_index_linter | Block usage of for loops directly overwriting the indexing variable
function_return_linter | Lint common mistakes/style issues cropping up from return statements
implicit_assignment_linter | implicit_assignment
is_numeric_linter | Redirect 'is.numeric(x) || is.integer(x)' to just use 'is.numeric(x)'
lengths_linter | Require usage of 'lengths()' where possible
length_levels_linter | Require usage of nlevels over length(levels(.))
length_test_linter | Check for a common mistake where length is applied in the wrong place
library_call_linter | Library call linter
lint | List all lints in a file or a directory
lint_dir | List all lints in a file or a directory
lint_package | List all lints in a file or a directory
lint_text | List all lints in a file or a directory
list_comparison_linter | Block usage of comparison operators with known-list() functions like lapply
list_linters | Get the list of linters in 'flir'
literal_coercion_linter | Require usage of correctly-typed literals over literal coercions
matrix_apply_linter | Require usage of 'colSums(x)' or 'rowSums(x)' over 'apply(x, ., sum)'
missing_argument_linter | Missing argument linter
nested_ifelse_linter | Block usage of nested 'ifelse()' calls
numeric_leading_zero_linter | Require usage of a leading zero in all fractional numerics
outer_negation_linter | Require usage of '!any(x)' over 'all(!x)', '!all(x)' over 'any(!x)'
package_hooks_linter | Package hooks linter
paste_linter | Raise lints for several common poor usages of 'paste()'
redundant_equals_linter | Block usage of '==', '!=' on logical vectors
redundant_ifelse_linter | Prevent 'ifelse()' from being used to produce 'TRUE'/'FALSE' or '1'/'0'
rep_len_linter | Require usage of rep_len(x, n) over rep(x, length.out = n)
right_assignment_linter | right_assignment
sample_int_linter | Require usage of sample.int(n, m, ...) over sample(1:n, m, ...)
seq_linter | Sequence linter
setup_flir | Setup flir
setup_flir_gha | Create a Github Actions workflow for 'flir'
sort_linter | Check for common mistakes around sorting vectors
stopifnot_all_linter | Block usage of all() within stopifnot()
todo_comment_linter | TODO comment linter
T_and_F_symbol_linter | 'T' and 'F' symbol linter
undesirable_function_linter | Undesirable function linter
undesirable_operator_linter | Undesirable operator linter
unnecessary_nesting_linter | Block instances of unnecessary nesting
which_grepl_linter | Require usage of grep over which(grepl(.))