Skip to content

Commit

Permalink
lintr
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed May 18, 2024
1 parent 7c09165 commit 3833677
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/data_extract.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ data_extract.data.frame <- function(data,
}

# we definitely should have a vector here when name not NULL
if (!is.null(name)) {
if (is.null(name)) {
data[, select, drop = !as_data_frame]
} else {
# if name indicates a variable, extract values for naming now
if (length(name) == 1L) {
name <- data[[name]]
}
stats::setNames(data[[select]], name)
} else {
data[, select, drop = !as_data_frame]
}
}

0 comments on commit 3833677

Please sign in to comment.