Skip to content

Commit 07c05b0

Browse files
committed
keep dimension when only 1 column left
1 parent 718bc14 commit 07c05b0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

R/functions.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
if (sum(k_singular) > 0)
55
warning(paste('Dropping single category variables:'),
66
paste(colnames(df)[k_singular], collapse=', '))
7-
df <- df[, !k_singular]
7+
df <- df[, !k_singular, drop=F]
8+
return(df)
89
}
910

1011
seurat2anndata <- function(
@@ -52,7 +53,7 @@ seurat2anndata <- function(
5253
)
5354

5455
if (!is.null(outFile))
55-
anndata$AnnData$write(adata, outFile, compression = 'gzip')
56+
adata$write(outFile, compression = 'gzip')
5657

5758
adata
5859
}

0 commit comments

Comments
 (0)