Skip to content

Dplyr bind_cols error #6907

Closed
Closed
@chrkuo

Description

@chrkuo

I am using semla and stutility to run spatial transcriptomic data. following their vignette when calculating nearest cluster neighbors to certain clusters I input a column thats nearest to cluster 4 for example, other spots that are not close to cluster 4 will be NA but when I run and try to map it - dplyr doesnt seem to be able to combine columns because the rows dont match. which is odd.

> EWS4064$cluster_4 <- ifelse(EWS4064$seurat_clusters %in% "4", "4", NA)
> MapLabels(EWS4064, column_name = "cluster_4", override_plot_dims = TRUE, 
+           image_use = "raw", drop_na = TRUE, pt_size = 2) +
+   plot_layout(guides = "collect") &
+   theme(legend.position = "right") &
+   guides(fill = guide_legend(override.aes = list(size = 3), ncol = 2))
Error in `bind_cols()`:
! Can't recycle `..1` (size 1681) to match `..2` (size 74).
Run `rlang::last_trace()` to see where the error occurred.
Warning message:
Removing 1607 cells missing data for vars requested 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions