Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Oct 1, 2024
1 parent 44ce84c commit 3831b8a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/check_dag.R
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,10 @@ check_dag <- function(...,
# x = c(score = 5, exp = 4, b = 3, c = 3),
# y = c(score = 3, exp = 3, b = 2, c = 4)
# )
if (!is.null(coords) && !is.data.frame(coords) && (length(coords) != 2 || !identical(names(coords), c("x", "y")))) { # nolint
#
# we have to check that it's not a data frame and that it is a list -
# values like `ggdag::time_ordered_coords()` returns a function, not a list
if (!is.null(coords) && !is.data.frame(coords) && is.list(coords) && (length(coords) != 2 || !identical(names(coords), c("x", "y")))) { # nolint
# transform list into data frame, split x and y coordinates into columns
coords <- datawizard::rownames_as_column(
stats::setNames(as.data.frame(do.call(rbind, coords)), c("x", "y")),
Expand Down

0 comments on commit 3831b8a

Please sign in to comment.