diff --git a/DESCRIPTION b/DESCRIPTION index a9713990..f2922170 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: dodgr Title: Distances on Directed Graphs -Version: 0.4.1.027 +Version: 0.4.1.028 Authors@R: c( person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre")), person("Andreas", "Petutschnig", role = "aut"), diff --git a/R/match-points.R b/R/match-points.R index 1e46cac5..32ab9fce 100644 --- a/R/match-points.R +++ b/R/match-points.R @@ -79,9 +79,6 @@ pre_process_xy <- function (xy) { } } - if (is (xy, "tbl")) { - xy <- data.frame (xy) - } if (is (xy, "sf")) { if (!"geometry" %in% names (xy)) { stop ("xy has no sf geometry column") @@ -93,6 +90,8 @@ pre_process_xy <- function (xy) { matrix (nrow = 2) %>% t () xy <- data.frame (x = xy [, 1], y = xy [, 2]) + } else if (is (xy, "tbl")) { + xy <- data.frame (xy) } else { xyi <- find_xy_col_simple (xy) xy <- data.frame (x = xy [, xyi [1]], y = xy [, xyi [2]]) diff --git a/codemeta.json b/codemeta.json index a8c27831..582296b1 100644 --- a/codemeta.json +++ b/codemeta.json @@ -11,7 +11,7 @@ "codeRepository": "https://github.com/UrbanAnalyst/dodgr", "issueTracker": "https://github.com/UrbanAnalyst/dodgr/issues", "license": "https://spdx.org/licenses/GPL-3.0", - "version": "0.4.1.027", + "version": "0.4.1.028", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", diff --git a/tests/testthat/test-match-pts-fns.R b/tests/testthat/test-match-pts-fns.R index ed088f1b..bac49a5a 100644 --- a/tests/testthat/test-match-pts-fns.R +++ b/tests/testthat/test-match-pts-fns.R @@ -8,6 +8,7 @@ clear_dodgr_cache () test_that ("points to verts", { + set.seed (1L) bb <- attr (hampi$geometry, "bbox") n <- 100 x <- bb [1] + (bb [3] - bb [1]) * runif (n)