Skip to content

Commit de34c9a

Browse files
committed
Merge branch 'master' of github.com:stemangiola/tidySingleCellExperiment
2 parents 71e9a46 + 8bdcbd6 commit de34c9a

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

R/tidyr_methods.R

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ NULL
5959
#'
6060
#'
6161
#' @export
62-
unnest.tidySingleCellExperiment_nested <- function(data, cols, ..., keep_empty=FALSE, ptype=NULL,
63-
names_sep=NULL, names_repair="check_unique", .drop, .id, .sep, .preserve) {
62+
unnest_single_cell_experiment <- function(data, cols, ..., keep_empty=FALSE, ptype=NULL,
63+
names_sep=NULL, names_repair="check_unique", .drop, .id, .sep, .preserve) {
6464
# Need this otherwise crashes map
6565
.data_ <- data
6666

@@ -75,16 +75,16 @@ unnest.tidySingleCellExperiment_nested <- function(data, cols, ..., keep_empty=F
7575
is("SingleCellExperiment") %>%
7676
any() ~
7777

78-
# Do my trick to unnest
79-
mutate(., !!cols := imap(
80-
!!cols, ~ .x %>%
81-
bind_cols_(
78+
# Do my trick to unnest
79+
mutate(., !!cols := imap(
80+
!!cols, ~ .x %>%
81+
bind_cols_(
8282

83-
# Attach back the columns used for nesting
84-
.data_ %>% select(-!!cols) %>% slice(rep(.y, nrow(as_tibble(.x))))
83+
# Attach back the columns used for nesting
84+
.data_ %>% select(-!!cols) %>% slice(rep(.y, nrow(as_tibble(.x))))
8585

86-
)
87-
)) %>%
86+
)
87+
)) %>%
8888
pull(!!cols) %>%
8989
reduce(bind_rows),
9090

@@ -96,6 +96,15 @@ unnest.tidySingleCellExperiment_nested <- function(data, cols, ..., keep_empty=F
9696
)
9797
}
9898

99+
#' @importFrom rlang quo_name
100+
#' @importFrom purrr imap
101+
#'
102+
#'
103+
#' @export
104+
unnest.tidySingleCellExperiment_nested <- unnest_single_cell_experiment
105+
106+
107+
99108
#' nest
100109
#'
101110
#' @importFrom tidyr nest

0 commit comments

Comments
 (0)