Skip to content

Commit

Permalink
fix: subsetGiottoLocs() subsets to be inclusive
Browse files Browse the repository at this point in the history
  • Loading branch information
jiajic committed Oct 23, 2024
1 parent ead8fae commit be5db47
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions R/subset.R
Original file line number Diff line number Diff line change
Expand Up @@ -1164,26 +1164,26 @@
if (is.null(x_max)) x_max <- max(comb_metadata[["sdimx"]])
if (is.null(x_min)) x_min <- min(comb_metadata[["sdimx"]])

comb_metadata <- comb_metadata[get("sdimx") < x_max &
get("sdimx") > x_min]
comb_metadata <- comb_metadata[get("sdimx") <= x_max &
get("sdimx") >= x_min]
}

# y spatial dimension
if ("sdimy" %in% comb_colnames) {
if (is.null(y_max)) y_max <- max(comb_metadata[["sdimy"]])
if (is.null(y_min)) y_min <- min(comb_metadata[["sdimy"]])

comb_metadata <- comb_metadata[get("sdimy") < y_max &
get("sdimy") > y_min]
comb_metadata <- comb_metadata[get("sdimy") <= y_max &
get("sdimy") >= y_min]
}

# z spatial dimension
if ("sdimz" %in% comb_colnames) {
if (is.null(z_max)) z_max <- max(comb_metadata[["sdimz"]])
if (is.null(z_min)) z_min <- min(comb_metadata[["sdimz"]])

comb_metadata <- comb_metadata[get("sdimz") < z_max &
get("sdimz") > z_min]
comb_metadata <- comb_metadata[get("sdimz") <= z_max &
get("sdimz") >= z_min]
}

if (return_gobject) {
Expand Down

0 comments on commit be5db47

Please sign in to comment.