nndist_func_plotter: nndist plotter and saver

View source: R/nndist_analysis_functions.R

nndist_func_plotterR Documentation

nndist plotter and saver

Description

Plot and Save Histograms of nearest neighbor distances (nndist)

Usage

nndist_func_plotter(
  image,
  image2 = NULL,
  nn_vec = 1:5,
  location = getwd(),
  image_name = "image",
  output = "save",
  xlim = c(0, 10),
  ylim = c(0, 0.5),
  binSize = 0.5,
  freq = FALSE,
  image_width = 600,
  image_height = 500,
  ...
)

Arguments

image

Point pattern for analysis (ppp or pp3)

image2

If a point pattern is given for image2, then nncross will be used

nn_vec

vector of nearest neighbors to calculate distance to

location

location to save image(s) if 'output' = 'save'

image_name

Name to save image as. The nearest neighbor number + 'nn.png' will be added to it

xlim

limits of x axis of histogram

ylim

limits of y axis of histogram

binSize

histogram bin size

freq

argument for hist function. logical; if TRUE, the histogram graphic is a representation of frequencies, the counts component of the result; if FALSE, probability densities, component density, are plotted (so that the histogram has a total area of one). Defaults to TRUE if and only if breaks are equidistant (and probability is not specified).

image_width

Width of image to be saved

image_height

Height of image to be saved

Details

Takes a point pattern as input (or two if using multitype nncross) and returns the histograms of all nearest neighbors in the nn_vec argument. If 'output' is set to "save", then it will also save the image.

Value

Describe output


rolandrolandroland/rTEM documentation built on March 29, 2025, 2:17 p.m.