Skip to content

Commit 3dce174

Browse files
committed
Make sure the unit has length 1
1 parent ef7929c commit 3dce174

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: SpatialFeatureExperiment
22
Type: Package
33
Title: Integrating SpatialExperiment with Simple Features in sf
4-
Version: 1.9.7
4+
Version: 1.9.8
55
Authors@R:
66
c(person("Lambda", "Moses", email = "[email protected]",
77
role = c("aut", "cre"),

R/SFE-class.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ SpatialFeatureExperiment <- function(assays,
142142
spatialGraphs = NULL,
143143
unit = c("full_res_image_pixel", "micron"),
144144
...) {
145+
unit <- match.arg(unit)
145146
if (!length(colData)) {
146147
colData <- make_zero_col_DFrame(nrow = ncol(assays[[1]]))
147148
}

tests/testthat/test-SFE-class.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ test_that("Not supplying colGeometries, supplying coordinates in colData", {
2020
colData = coords1,
2121
spatialCoordsNames = c("col", "row")
2222
)
23+
expect_equal(unit(sfe), "full_res_image_pixel")
2324
expect_equal(colGeometryNames(sfe), "centroids")
2425
expect_equal(as.character(st_geometry_type(colGeometry(sfe),
2526
by_geometry = FALSE

0 commit comments

Comments
 (0)