From b8dd0e2d7101c7aed7a389634a5fe96021897aef Mon Sep 17 00:00:00 2001 From: Kaelyn Rosenberg Date: Fri, 31 Oct 2025 15:57:08 -0500 Subject: [PATCH 1/2] update contiguous check --- .Rbuildignore | 1 + R/generate_map.R | 2 +- R/many_maps.R | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 546c1d5..3dca4ff 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -9,3 +9,4 @@ ^_pkgdown\.yml$ ^docs$ ^pkgdown$ +^CRAN-SUBMISSION$ diff --git a/R/generate_map.R b/R/generate_map.R index 415b983..f836fc5 100644 --- a/R/generate_map.R +++ b/R/generate_map.R @@ -66,7 +66,7 @@ generate_map <- function(data, square = TRUE, flat_topped = FALSE, prop = 0, neighbor_graph <- igraph::graph_from_adjacency_matrix(neighbor_matrix) neighbor_search <- igraph::bfs(neighbor_graph, 1, mode = "all", unreachable = FALSE)$order - if (any(is.na(neighbor_search))) { + if (length(neighbor_search) != R) { stop("regions are not contiguous") } diff --git a/R/many_maps.R b/R/many_maps.R index 8129534..b9ab0f8 100644 --- a/R/many_maps.R +++ b/R/many_maps.R @@ -95,7 +95,7 @@ many_maps <- function(data, labels, square = TRUE, flat_topped = FALSE, neighbor_graph <- igraph::graph_from_adjacency_matrix(neighbor_matrix) neighbor_search <- igraph::bfs(neighbor_graph, 1, mode = "all", unreachable = FALSE)$order - if (any(is.na(neighbor_search))) { + if (length(neighbor_search) != R) { stop("regions are not contiguous") } From 71b74898156c6cfa4f57afc1d52040505f70ed7c Mon Sep 17 00:00:00 2001 From: Kaelyn Rosenberg Date: Mon, 3 Nov 2025 15:15:38 -0600 Subject: [PATCH 2/2] update for version 0.2.2 --- DESCRIPTION | 2 +- NEWS.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index e9bcd04..22a7563 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: tilemaps Title: Generate Tile Maps -Version: 0.2.1 +Version: 0.2.2 Authors@R: person(given = "Kaelyn", family = "Rosenberg", diff --git a/NEWS.md b/NEWS.md index bf3a327..9e5c123 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +## Version 0.2.2 +- Updated check for contiguous regions + ## Version 0.2.1 - Updated deprecated argument in `igraph::bfs()` function