assign_analyte_id | R Documentation |
Replace internal cluster IDs with informative analyte IDs
assign_analyte_id(
df,
.parameter,
.analyte_id,
.column_name,
.cluster_column_name = paste0("cluster_", .column_name),
.desc = FALSE,
.data = NULL
)
df |
The tidy data.frame, with indication of clusters |
.parameter |
The parameter to order the cluster centers by |
.analyte_id |
A character vector giving the name of the clusters. The order is important and must match the expected order of clusters. |
.column_name |
A character giving the name of the column to hold the analyte ID. If the column exists it will be silently dropped. |
.cluster_column_name |
A character giving the name of the column where the clusters are identified. Will be dropped from the data.frame. |
.desc |
A boolean giving whether the sort order is descending. |
.data |
Deprecated. Use |
A data.frame with cluster names instead of cluster ids.
## Not run:
library(beadplexr)
library(ggplot2)
data("lplex")
df <- lplex[[1]] |>
bp_clara(.parameter = c("FSC-A", "SSC-A"), .column_name = "analyte", .k = 2)
df |>
beadplexr:::assign_analyte_id(.parameter = c("FSC-A", "SSC-A"),
.analyte_id = c("A", "B"),
.column_name = "pop name",
.cluster_column_name = "analyte") |>
ggplot() +
aes(x = `FSC-A`, y = `SSC-A`, colour = `pop name`) +
geom_point()
df |>
beadplexr:::assign_analyte_id(.parameter = c("FSC-A", "SSC-A"),
.analyte_id = c("A", "B"),
.column_name = "pop name",
.cluster_column_name = "analyte", .desc = TRUE) |>
ggplot() +
aes(x = `FSC-A`, y = `SSC-A`, colour = `pop name`) +
geom_point()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.