Fix issue with adding attributes
authorPaul Hoffman <phoffman@nygenome.org>
Thu, 9 Nov 2017 17:19:38 +0000 (12:19 -0500)
committerPaul Hoffman <phoffman@nygenome.org>
Thu, 9 Nov 2017 17:19:38 +0000 (12:19 -0500)
R/loom.R

index 493d5105f3c1200fa8bff8e8f65057cbe89d052a..ae4351e3d099259c98dbfd0e98e9500c420d0286 100644 (file)
--- a/R/loom.R
+++ b/R/loom.R
@@ -218,7 +218,7 @@ loom <- R6Class(
       grp.name <- c('row_attrs', 'col_attrs')[MARGIN]
       grp <- self[[grp.name]]
       for (i in 1:length(x = attribute)) {
-        if (length(attribute[[i]]) != self$shape[MARGIN])
+        if (length(attribute[[i]]) != rev(x = self$shape)[MARGIN])
           stop(paste(
             "All",
             switch(EXPR = MARGIN, '1' = 'gene', '2' = 'cell'),