create_clus: Create point clusters arround sample locations

Description Usage Arguments Details Value Author(s) Examples

View source: R/response_design.R

Description

Create point clusters arround sample locations

Usage

1
create_clus(dt_s, col_off, row_off, sp_dist)

Arguments

dt_s

A data.table object storing sample locations as returned from create_sys. Column names must be identical to "row", "col", and "id". The first stores the row index, the second the column index, and the last an identifier.

col_off

A vector specifying the offset of sub-plot coordinates from the origin in x-direction. See details.

row_off

A vector specifying the offset of sub-plot coordinates from the origin in y-direction. See details.

sp_dist

The distance between sub-plots.

Details

The parameters col_off, row_off, and sp_dist are used to specify the size and shape of the point cluster. For the number of sub-plots and their spatial arrangement around a reference point, use col_off and row_off. There are as many sub-plots as values in the two vectors. The two vectors must have the same length, as values are interpreted as coordinate pairs. The location of the reference point is defined by offset values (see the example). sp_dist can be used to control the distance between sub-plots. If used, the values in col_off and row_off should be relative to the reference point. If set to a value of one, it has no effect and offsets can be specified in absolut values from the reference.

Value

A data.table object with row and column indices of the generated clusters

Author(s)

Sebastian Schnell

Examples

1
2
3
4
5
6
7
8
dt_s <- data.table(row = c(10, 10, 20, 20),
                   col= c(10, 20, 20, 10), id = c(1:4));

dt_s_cl <- create_clus(dt_s, col_off = c(-1, 1, 1, -1),
                       row_off = c(-1, -1, 1, 1),
                       sp_dist = 3);

dt_s_cl[, plot(col, row)]; dt_s[, points(col, row, pch = 16)];

sebschnell/gsgsim documentation built on May 20, 2019, 2:01 p.m.