create.rawDist: Create rawDist data from arbitary coordinates

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/create.rawDist.R

Description

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

Usage

1
2
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.

Details

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

Value

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

Author(s)

Mikko Vihtakari

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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)

sclero documentation built on May 2, 2019, 2:26 p.m.