Skip to content

Commit

Permalink
need to splice the list for fct_attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
emitanaka committed Sep 14, 2023
1 parent ec45748 commit 59f55ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions R/attrs.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#' @export
fct_attrs <- function(.levels, ...) {
dots <- dots_list(..., .named = TRUE, .homonyms = "keep", .ignore_empty = "all")

if(length(dots)) {
for(x in dots) {
if(!is_null(x)) {
Expand Down
6 changes: 3 additions & 3 deletions R/graph-input.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ graph_input_type = function(input) {
graph_input.default <- function(input, prov, name, class, ...) {
type <- graph_input_type(input)
levels <- switch(type,
"numeric" = fct_attrs(lvls(label_seq_length(input, prefix = name)), attr(input, "attrs")),
"unnamed_vector" = fct_attrs(lvls(input), attr(input, "attrs")),
"numeric" = fct_attrs(lvls(label_seq_length(input, prefix = name)), !!!attr(input, "attrs")),
"unnamed_vector" = fct_attrs(lvls(input), !!!attr(input, "attrs")),
"named_vector" = fct_attrs(lvls(names(input),
rep = unname(input)),
attr(input, "attrs")),
!!!attr(input, "attrs")),
"unimplemented" = abort(paste0("Not sure how to handle ", class(input)[1])))
graph_input.edbl_lvls(levels, prov, name, class)
}
Expand Down

0 comments on commit 59f55ea

Please sign in to comment.