R/calculate_k_function.R
calculate_k_function.Rd
Returns K function of cell distribution
calculate_k_function( point_pattern, phenotypes_of_interest = NULL, determine_confidence = NULL, plot_envelope = NULL, plot = 1 )
point_pattern | ppp object used as input data for K function |
---|---|
phenotypes_of_interest | String supplying the phenotype of interest, if unspecified the entire point pattern will be considered |
determine_confidence | Indicate to plot confidence interval of the K function calculated (adds significant run time) |
plot_envelope | Indicates whether the significance envelope of simulated data should be plotted (based on inhomogenous Poisson distribution) |
plot | Indicates whether to plot K-function |
Inputs - point_pattern: ppp object (marked) to determine K function determine_confidence: assign any integer value to indicate to plot the confidence interval for the K-function itself. Set to NULL as default, calculating this can be computationally expensive phenotypes_of_interest: the cell phenotype/phenotypes to be considered in the K-function calculation if not the entire ppp object. Set to NULL as default plot_envelope: assign any integer value to indicate to plot the envelope of the simulated inhomogenous poisson distribution plot: assign any integer value to indicate to plot the K-function itself, default is to plot. Set to NULL if plot is not to be produced Outputs - k_function: Array containing values required to plot K function and the associated inhomogenous Poisson distribution (null distribution)