Skip to content

Commit ae8d550

Browse files
committed
simplify
1 parent 6e5fc7e commit ae8d550

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

R/plotLabel.R

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,17 @@ setMethod("plotLabel", "SpatialData", \(x, i=1, j=1, k=NULL, c=NULL,
7575
ym <- .project(y, ym, z)
7676
axisNames <- axisNames[axisNames != "z"]
7777
# subset to selected time
78-
tidx <- which(axisNames=="t")
79-
if (length(tidx)>0) {
78+
tidx <- which(axisNames == "t")
79+
if (length(tidx) > 0) {
8080
if (is.null(t)) {
8181
t <- 1
8282
}
83-
if (length(t)>1) {
83+
if (length(t) > 1) {
8484
stop("Only a single timepoint can be selected")
8585
}
8686
ym <- .subset_array_by_axes(a=ym, axisNames=axisNames,
8787
t=t, drop=FALSE)
88-
dim(ym) <- dim(ym)[axisNames!="t"]
89-
axisNames <- axisNames[-tidx]
88+
dim(ym) <- dim(ym)[axisNames != "t"]
9089
}
9190

9291
# keep only indices != 0 since labels might be sparse

0 commit comments

Comments
 (0)