add_outline_variable | R Documentation |
Adds a variable called outline to the input data.frame that tells if the observation belongs to the points that lie on the edge of the covered area.
add_outline_variable(input_df, id_var = "barcodes")
input_df |
A data.frame with two numeric variables called x and y
and a variable as denoted in |
id_var |
Character. Variable that identifies each observation. |
Input data.frame with additional logical variable outline.
library(ggplot2)
object <- downloadPubExample("313_T")
pt_size <- getDefault(objet, "pt_size")
coords_df <- getCoordsDf(object)[, c("barcodes", "x", "y")]
head(coords_df)
ggplot(data = coords_df) +
geom_point_fixed(mapping = aes(x = x, y = y), size = pt_size) +
theme_void()
coords_df2 <- add_outline_variable(coords_df, id_var = "barcodes")
ggplot(data = coords_df2) +
geom_point_fixed(mapping = aes(x = x, y = y, color = outline), size = pt_size) +
theme_void()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.