Skip to content

Commit

Permalink
lintr
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Dec 19, 2023
1 parent 2babedb commit 47b001d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion R/data_seek.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ data_seek <- function(data, pattern, seek = c("names", "labels"), fuzzy = FALSE)
# check valid args
seek <- intersect(seek, c("names", "labels", "values", "levels", "column_names", "columns", "all"))
if (is.null(seek) || !length(seek)) {
insight::format_error("`seek` must be one of \"names\", \"labels\", \"values\", a combination of these options, or \"all\".")
insight::format_error("`seek` must be one of \"names\", \"labels\", \"values\", a combination of these options, or \"all\".") # nolint
}

pos1 <- pos2 <- pos3 <- NULL
Expand Down
10 changes: 4 additions & 6 deletions R/data_separate.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,12 @@ data_separate <- function(data,
# if no column names provided, use standard names
if (is.null(new_columns[[sep_column]])) {
new_column_names <- paste0(sep_column, "_", seq_along(out))
} else {
} else if (make_unique_colnames) {
# if we have multiple columns that were separated, we avoid duplicated
# column names of created variables by appending name of original column
if (make_unique_colnames) {
new_column_names <- paste0(sep_column, "_", new_columns[[sep_column]])
} else {
new_column_names <- new_columns[[sep_column]]
}
new_column_names <- paste0(sep_column, "_", new_columns[[sep_column]])
} else {
new_column_names <- new_columns[[sep_column]]
}

colnames(out) <- new_column_names
Expand Down

0 comments on commit 47b001d

Please sign in to comment.