SMOLR_TO_PPP: Convert localizations to point pattern for spatstat package

View source: R/smolr_to_ppp.R

SMOLR_TO_PPPR Documentation

Convert localizations to point pattern for spatstat package

Description

A function to convert localization data coordinates to point patterns for the spatstat package. Input can be separate vectors, data.frame or a list of data.frames.

Usage

SMOLR_TO_PPP(x, y, xlim, ylim, marks, shape)

Arguments

x

X coordinates in nm, or a data.frame or list of data.frames with localization data.

y

Y coordinates in nm

xlim

Vector with the upper and lower limit of x coordinates

ylim

Vector with the upper and lower limit of y coordinates

marks

Vector to indictate different types/channels of the coordinates. If list or data.frame is used as input the channel column will be used for the marks.

shape

Shape of the point pattern, either a rectangle ("rect") or circle ("circle"). Default is "rect".

Value

Returns a spatstat ppp object, or a list of ppp objects.

Author(s)

Optical Imaging Centre ErasmusMC Rotterdam

See Also

ppp

Examples

example <- SMOLR_TO_PPP(smolrdata)
plot(example)
## The function is currently defined as
function (x, y, xlim, ylim, marks, shape) 
{
    UseMethod("smlmr_to_ppp")
  }


#make triangulation plot
x <- SMOLR_TO_PPP(smolrdata)
#channel 1
plot(dirichlet(x[x$marks==1]))

ErasmusOIC/SMoLR documentation built on July 27, 2023, 8:05 p.m.