set stringsAsFactors = FALSE in get.attribute.df
authorChristoph Hafemeister <chafemeister@nygenome.org>
Wed, 21 Mar 2018 21:51:12 +0000 (22:51 +0100)
committerChristoph Hafemeister <chafemeister@nygenome.org>
Wed, 21 Mar 2018 21:51:12 +0000 (22:51 +0100)
R/loom.R

index c63be7f96d31b52a7594725f9839eddd442673ec..4b075ce75ea60d7b789f755add636277a81a03dd 100644 (file)
--- a/R/loom.R
+++ b/R/loom.R
@@ -400,7 +400,7 @@ loom <- R6Class(
       attr.paths <- paste0(attribute.layer, "/", attribute.names)
       # keep only the one-dimensional attributes
       dims <- sapply(attr.paths, function(x) length(self[[x]]$dims))
-      data.lst <- lapply(attr.paths[dims == 1], function(x) data.frame(self[[x]][]))
+      data.lst <- lapply(attr.paths[dims == 1], function(x) data.frame(self[[x]][], stringsAsFactors = FALSE))
       combined.df <- Reduce(cbind, data.lst)
       colnames(combined.df) <- attribute.names[dims == 1]
       if (attribute.layer == "col_attrs") {