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