plot_dims {clustifyr} | R Documentation

## Plot a tSNE or umap colored by feature.

### Description

Plot a tSNE or umap colored by feature.

### Usage

    plot_dims(
      data,
      x = "UMAP_1",
      y = "UMAP_2",
      feature = NULL,
      legend_name = "",
      c_cols = pretty_palette2,
      d_cols = NULL,
      pt_size = 0.25,
      alpha_col = NULL,
      group_col = NULL,
      scale_limits = NULL,
      do_label = FALSE,
      do_legend = TRUE,
      do_repel = TRUE
    )

### Arguments

`data` | input data
`x` | x variable
`y` | y variable
`feature` | feature to color by
`legend_name` | legend name to display, defaults to no name
`c_cols` | character vector of colors to build color gradient for continuous values, defaults to `clustifyr::pretty_palette`
`d_cols` | character vector of colors for discrete values. defaults to RColorBrewer paired palette
`pt_size` | point size
`alpha_col` | whether to refer to data column for alpha values
`group_col` | group by another column instead of feature, useful for labels
`scale_limits` | defaults to min = 0, max = max(data$x), otherwise a two-element numeric vector indicating min and max to plot
`do_label` | whether to label each cluster at median center
`do_legend` | whether to draw legend
`do_repel` | whether to use ggrepel on labels

### Value

ggplot object, cells projected by dr, colored by feature

### Examples

    plot_dims(
        pbmc_meta,
        feature = "classified"
    )

[Package clustifyr version 1.0.0 Index]