plotSasBarplot | R Documentation |
Plots changes in grouping proportion against the distance to a spatial annotation.
plotSasBarplot(
object,
grouping,
id = idSA(object),
distance = distToEdge(object, id),
resolution = getCCD(object) * 2,
unit = getDefaultUnit(object),
angle_span = c(0, 360),
core = FALSE,
round = 2,
clrp = NULL,
clrp_adjust = NULL,
position = "fill",
bar_width = 0.025,
expand_x = c(0.025, 0),
expand_y = c(0.0125, 0),
verbose = NULL,
...
)
object |
An object of class |
grouping |
Character value. The grouping variable of interest. Use
|
distance |
|
resolution |
Distance measure. The resolution
with which the expression gradient is inferred. Defaults are platform specific.
See more in detail section of |
unit |
Character value. The unit in which the distance to the spatial annotation is displayed on the x-axis. If |
angle_span |
Numeric vector of length 2. Confines the area screened by an angle span relative to the center of its closest spatial annotation. |
clrp |
Character value. Specifies the color palette to be used to represent
groups of discrete variables. Run |
clrp_adjust |
Named character vector or NULL. If character, it adjusts the color palette that is used to represent the groups. Names of the input vector must refer to the group and the respective named element denotes the color with which to represent the group. |
expand_x , expand_y |
Given to argument |
verbose |
Logical. If (Warning messages will always be printed.) |
... |
Needed arguments that depend on the input/unit combination. If
one of both is 'px', argument |
A ggplot.
The vignette on distance measures in SPATA2 has been replaced. Click
here
to read it.
library(SPATA2)
data("example_data")
object <- example_data$object_UKF275T_diet
object <-
createNumericAnnotations(
object = object,
variable = "HM_HYPOXIA",
threshold = "kmeans_high",
id = "hypoxia_ann",
inner_borders = FALSE,
force1 = TRUE
)
plotSurface(object, color_by = "bayes_space") +
ggpLayerSpatAnnOutline(object, ids = "hypoxia_ann")
plotSasBarplot(object, grouping = "bayes_space", id = "hypoxia_ann")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.