Learn R Programming

sclero (version 0.2)

create.rawDist: Create rawDist data from arbitary coordinates

Description

Creates a rawDist data object from arbitary coordinates ready for plotting or sample spot alignment.

Usage

create.rawDist(spots, gbs, main, spot.seq.names = NULL, sample.name = NULL, scaling.factor = 1, unit = NULL)

Arguments

spots
A list of ppp objects or a single ppp object defining the sample spot sequences. If marks are not specified, sequencial names will be used.
gbs
psp object defining the growth lines. If marks are not specified, sequencial names will be used.
main
psp object defining the measurement axis. If marks are not specified, sequencial 'main' will assigned as the marks. Only on `main` axis is allowed per `rawDist` object.
spot.seq.names
optional. A character vector of equal length to number of sample spots sequences defining the name for each sequence. If left empty sequencial names will be generated.
sample.name
optional. A character vector (length == 1) defining the name of the sample.
scaling.factor
optional. A numeric value defining the scale of photograph in pixels / unit. Defaults to 1.
unit
optional. A charater vector (length == 1) defining the unit of measurements. See scale.

Value

Returns a list of class rawDist, which contains spatstat point patterns. The returned rawDist can be plotted using the generic plotting command.

Details

This function can be used to create arbitary test data, which can be passed further on in sclero package function hierarchy.

See Also

read.ijdata for generating IJDATA objects.

convert.ijdata for converting IJDATA objects to rawDist objects.

plot.rawDist for plotting.

spot.dist for aligning sample spots.

Examples

Run this code
dev.off()
W <- square(10)
S <- ppp(x = c(7, 5, 3), y = rep(5,3), window = W)
G <- psp(x0 = c(8,6,4,2), y0 = rep(2,4), x1 = c(8,6,4,2), y1 = rep(8,4), window = W)
M <- psp(x0 = 0, x1 = 8, y0 = 5, y1 = 5, window = W)
x <- create.rawDist(spots = S, gbs = G, main = M)
plot(x)

## Generate random points for alignment
set.seed(1)
S <- rpoint(n = 5, win = owin(xrange = c(2,7), yrange = c(5,7)))
S$window <- W
G <- psp(x0 = c(7,5,3,1), y0 = rep(2,4), x1 = c(9,7,5,3), y1 = rep(8,4), window = W)
M <- psp(x0 = 0, x1 = 8, y0 = 1, y1 = 1, window = W)
x <- create.rawDist(spots = S, gbs = G, main = M)
plot(x)
y <- spot.dist(x)
plot(y)

Run the code above in your browser using DataLab