View source: R/view-composers.R
add_juxtaview | R Documentation |
The juxtaview captures the expression of all markers within the immediate neighborhood of a spatial unit.
add_juxtaview(
current.views,
positions,
neighbor.thr = 15,
prefix = "",
cached = FALSE,
verbose = TRUE
)
current.views |
the current view composition. |
positions |
a |
neighbor.thr |
a threshold value used to indicate the largest distance between two spatial units that can be considered as neighboring. |
prefix |
a prefix to add to the column names. |
cached |
a |
verbose |
a |
The neighborhood of each spatial unit is estimated by constructing a graph by
2D Delaunay triangulation following by removal of edges with length larger than
neighbor.thr
. For each spatial unit the juxtaview contains the sum of
expressions across its estimated neighbors for each marker.
A mistyR view composition with added juxtaview.
create_initial_view()
for
starting a view composition with an intraview only.
Other view composition functions:
add_paraview()
,
add_views()
,
create_initial_view()
,
create_view()
,
remove_views()
# Create a view composition of an intraview and a juxtaview.
library(dplyr)
# get the expression data
data("synthetic")
expr <- synthetic[[1]] %>% select(-c(row, col, type))
# get the coordinates for each cell
pos <- synthetic[[1]] %>% select(row, col)
# compose
misty.views <- create_initial_view(expr) %>% add_juxtaview(pos, neighbor.thr = 1.5)
# preview
str(misty.views[["juxtaview.1.5"]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.