knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(rlang) library(ggseurat) library(patchwork) data("pbmc_small") p <- ggplot(data = pbmc_small, mapping = aes(x = tSNE_1, y = tSNE_2)) + cowplot::theme_cowplot()
p + geom_point(aes(color = ident))
# features <- c("LYZ", "CCL5", "IL32", "PTPRCAP", "FCGR3A", "PF4") features <- c("LYZ", "CCL5", "IL32", "FCGR3A", "PF4") plots <- vector("list", length = length(features)) for (i in seq_along(plots)) { var <- sym(features[i]) plots[[i]] <- p + geom_point(aes(color = !!var)) + scale_color_gradientn(colors = c("lightgrey", "purple")) } wrap_plots(plots)
var <- sym("MS4A1") p + geom_point(aes(color = !!var)) + scale_color_gradientn(colors = c("lightgrey", "purple")) + facet_wrap(facets = "groups")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.