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 34d0c69 commit 7c065de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/check_dag.R
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ check_dag <- function(...,

.process_coords <- function(coords) {
# check if the coords are not provided as list with x/y elements, but instead
# x/y coordinates for each element. This means, "coords" is provided as
# as list x/y coordinates for each element. This means, "coords" is provided as
#
# coords <- list(
# score = c(5, 3),
Expand All @@ -384,7 +384,7 @@ 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) && (length(coords) != 2 || !identical(names(coords), c("x", "y")))) {
if (!is.null(coords) && !is.data.frame(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 7c065de

Please sign in to comment.