View source: R/nndist_analysis_functions.R
percent_neighbors | R Documentation |
Calculate either the average fraction of points in object 'image' at distances 'rads_vec' from each point of type 'i' that are type 'i' ('value' = "distance") or the average fraction of each nearest neighbor in 'nn_vec' of each point of type 'i' that is type 'i' 'value' = "NN").
percent_neighbors(
pattern,
i,
window = NULL,
drop_isolated = FALSE,
value = "NN",
rads_vec = 1:25,
nn_vec = 1:5,
output = "plot",
location = getwd(),
image_name = "image",
unit = "nm",
round_to = 3,
...
)
pattern |
Image of type ppp or pp3 |
i |
mark for point type to be used |
value |
Determines output. If = "NN" then returns fraction of all nearest neighbors in nn_vec that are same type. If = "distance" then returns fraction of all points within distances in rads_vec that are same type |
rads_vec |
vector of distances to calculate |
nn_vec |
vector of integers values of nearest neighbors |
output |
set to "plot" (default) if only plotting. Set to "save" if plotting and saving |
location |
location to save image to if 'output = save'. default is working directory. |
image_name |
Name to save image as. Will have '_NN_dist_perc.png' added to it if 'value' = "percent" or '_NN_perc_dist.png' if 'value' = "distance" |
unit |
distance unit name to be added to output name |
round_to |
number of decimal places to round values to |
vector of fractions
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.