# will produce lints
lint(
text = "apply(x, 1, sum)",
linters = matrix_apply_linter()
)
lint(
text = "apply(x, 2, sum)",
linters = matrix_apply_linter()
)
lint(
text = "apply(x, 2, sum, na.rm = TRUE)",
linters = matrix_apply_linter()
)
lint(
text = "apply(x, 2:4, sum)",
linters = matrix_apply_linter()
)
# okay
lint(
text = "rowSums(x)",
linters = matrix_apply_linter()
)
lint(
text = "colSums(x)",
linters = matrix_apply_linter()
)
lint(
text = "colSums(x, na.rm = TRUE)",
linters = matrix_apply_linter()
)
lint(
text = "rowSums(colSums(x), dims = 3)",
linters = matrix_apply_linter()
)
Run the code above in your browser using DataLab