@@ -107,13 +107,11 @@ readShape <- function(x, ...) {
107107
108108# ' @rdname readSpatialData
109109# ' @importFrom anndataR read_zarr
110+ # ' @importFrom Rarr read_zarr_attributes
110111# ' @importFrom S4Vectors metadata metadata<-
111- # ' @importFrom SummarizedExperiment colData colData<-
112- # ' @importFrom SingleCellExperiment
113- # ' int_metadata int_metadata<-
114- # ' int_colData int_colData<-
112+ # ' @importFrom SingleCellExperiment int_metadata int_metadata<-
115113# ' @export
116- readTable <- function (x ) {
114+ readTable <- \ (x ) {
117115 # suppress warnings related to hidden files
118116 za <- read_zarr_attributes(x )
119117 suppressWarnings(x <- read_zarr(x , as = " SingleCellExperiment" ))
@@ -147,8 +145,8 @@ readSpatialData <- \(x,
147145 j <- list.dirs(y , recursive = FALSE )
148146 names(j ) <- basename(j )
149147 if (! isTRUE(opt <- args [[i ]])) {
150- if (is.numeric(opt ) && opt > (. <- length(j )))
151- stop(" '" , i , " =" , opt , " ', but only " , . , " elements found " )
148+ if (is.numeric(opt ) && any( opt > (. <- length(j ) )))
149+ stop(" '" , i , " =" , opt , " ', but found only " , . )
152150 if (is.character(opt ) && length(. <- setdiff(opt , basename(j ))))
153151 stop(" couln't find " , i , " of name" , . )
154152 j <- j [opt ]
0 commit comments