p_rep_check_by_density: Generate a spatial layout of checks by density: p rep design...

Description Usage Arguments Value Examples

View source: R/p_rep_check_by_density.R

Description

This function generate a check layout in a retangular grid. the check and partial replicated entries are spread by blocksdesign library

Usage

1
p_rep_check_by_density(n.row, n.col, check.density = 0.05, by.density)

Arguments

n.row

The row of a retangular grid

n.col

The column of a retangular grid

check.density

The density of the check

by.density

The total density of check and p_rep, MUST be a even decimal number after substract the check.density

Value

A dataframe will return: row.var=row, col.var=col, check=0, single rep; 1, check; else, partial replicated entries

Examples

1
2
3
4
# To produce a 20 by 20 field with check distributed by density=0.35
nr = 20; nc = 20
example.tmp = p_rep_check_by_density(nr, nc, by.density=.35)
fields::quilt.plot(example.tmp, nx=nr, ny=nc)

Example output

Loading required package: fields
Loading required package: spam
Loading required package: dotCall64
Loading required package: grid
Spam version 2.2-2 (2019-03-07) is loaded.
Type 'help( Spam)' or 'demo( spam)' for a short introduction 
and overview of this package.
Help for individual functions is also obtained by adding the
suffix '.spam' to the function name, e.g. 'help( chol.spam)'.

Attaching package: 'spam'

The following objects are masked from 'package:base':

    backsolve, forwardsolve

Loading required package: maps
See https://github.com/NCAR/Fields for
 an extensive vignette, other supplements and source code 
Loading required package: reshape2

SpatialFloor documentation built on May 2, 2019, 1:45 p.m.