Skip to content

Commit 47b001d

Browse files
committed
lintr
1 parent 2babedb commit 47b001d

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

R/data_seek.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ data_seek <- function(data, pattern, seek = c("names", "labels"), fuzzy = FALSE)
6363
# check valid args
6464
seek <- intersect(seek, c("names", "labels", "values", "levels", "column_names", "columns", "all"))
6565
if (is.null(seek) || !length(seek)) {
66-
insight::format_error("`seek` must be one of \"names\", \"labels\", \"values\", a combination of these options, or \"all\".")
66+
insight::format_error("`seek` must be one of \"names\", \"labels\", \"values\", a combination of these options, or \"all\".") # nolint
6767
}
6868

6969
pos1 <- pos2 <- pos3 <- NULL

R/data_separate.R

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,12 @@ data_separate <- function(data,
264264
# if no column names provided, use standard names
265265
if (is.null(new_columns[[sep_column]])) {
266266
new_column_names <- paste0(sep_column, "_", seq_along(out))
267-
} else {
267+
} else if (make_unique_colnames) {
268268
# if we have multiple columns that were separated, we avoid duplicated
269269
# column names of created variables by appending name of original column
270-
if (make_unique_colnames) {
271-
new_column_names <- paste0(sep_column, "_", new_columns[[sep_column]])
272-
} else {
273-
new_column_names <- new_columns[[sep_column]]
274-
}
270+
new_column_names <- paste0(sep_column, "_", new_columns[[sep_column]])
271+
} else {
272+
new_column_names <- new_columns[[sep_column]]
275273
}
276274

277275
colnames(out) <- new_column_names

0 commit comments

Comments
 (0)