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")

Arguments

input_df

A data.frame with two numeric variables called x and y and a variable as denoted in id_var.

id_var

Character. Variable that identifies each observation.

Value

Input data.frame with additional logical variable outline.

Examples


 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()