Skip to content

Commit ed115b2

Browse files
committed
Use anyDuplicated() where possible
1 parent 49e4dae commit ed115b2

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

.lintr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
linters: linters_with_defaults(
22
line_length_linter = line_length_linter(120L),
33
any_is_na_linter(),
4+
any_duplicated_linter(),
45
outer_negation_linter(),
56
nzchar_linter(),
67
fixed_regex_linter(),

R/as_Seurat.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ as_Seurat <- function(
211211
} else if (!is.null(adata$X)) {
212212
layers_mapping[["X"]] <- NA
213213
}
214-
if (any(duplicated(names(layers_mapping)))) {
214+
if (anyDuplicated(names(layers_mapping)) > 0) {
215215
cli_abort(
216216
"{.arg layers_mapping} or {.arg x_mapping} must not contain any duplicate names",
217217
"i" = "Found duplicate names: {.val {names(layers_mapping)[duplicated(names(layers_mapping))]}}"

R/as_SingleCellExperiment.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ as_SingleCellExperiment <- function(
216216
} else if (!is.null(adata$X)) {
217217
assays_mapping[["X"]] <- NA
218218
}
219-
if (any(duplicated(names(assays_mapping)))) {
219+
if (anyDuplicated(names(assays_mapping)) > 0) {
220220
cli_abort(
221221
"{.arg assays_mapping} or {.arg x_mapping} must not contain any duplicate names",
222222
"i" = "Found duplicate names: {.val {names(assays_mapping)[duplicated(names(assays_mapping))]}}"

0 commit comments

Comments
 (0)