Skip to content

Commit

Permalink
as_list -> as.list
Browse files Browse the repository at this point in the history
  • Loading branch information
pvictor committed Jan 8, 2024
1 parent baa1025 commit bc9dd50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ importFrom(rio,import)
importFrom(rlang,"%||%")
importFrom(rlang,as_function)
importFrom(rlang,as_label)
importFrom(rlang,as_list)
importFrom(rlang,enquo)
importFrom(rlang,eval_tidy)
importFrom(rlang,exec)
Expand Down
6 changes: 3 additions & 3 deletions R/edit-data-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ rename_edit <- function(data, var_labels) {
}


#' @importFrom rlang set_names is_null as_list is_list is_named
#' @importFrom rlang set_names is_null is_list is_named
get_variables_labels <- function(labels, column_names, internal_names) {
if (is_null(labels)) {
labels <- column_names
Expand All @@ -262,14 +262,14 @@ get_variables_labels <- function(labels, column_names, internal_names) {
stopifnot(
"If `var_labels` is an unnamed vector, it must have same length as `colnames(data)`" = length(labels) == length(column_names)
)
labels <- set_names(as_list(labels), column_names)
labels <- set_names(as.list(labels), column_names)
}
stopifnot(
"`var_labels` must be a named list" = is_named(labels)
)
names(labels) <- internal_names[match(names(labels), column_names)]
labels <- modifyList(
x = set_names(as_list(column_names), internal_names),
x = set_names(as.list(column_names), internal_names),
val = labels
)
}
Expand Down

0 comments on commit bc9dd50

Please sign in to comment.