expDesign: Allocation of varieties to farmers

Description Usage Arguments Value Examples

View source: R/expDesign.R

Description

Generate experimental designs to allocate vartieties to farmers. 17 experimental designs are included, namely they are AP, RD, KM1~KM6, GD1~GD9 (see the vignette for details)

Usage

1
expDesign(nvar, nobs, method, marker = NA)

Arguments

nvar

the number of varieties

nobs

the number of farmers (observers), must be greater than or equal to nvar / 3

method

must be one of "alpha", "random", "KM1", "KM2", "KM3", "KM4", "KM5", "KM6", "GD1", "GD2", "GD3", "GD4", "GD5", "GD6", "GD7", "GD8", "GD9"

marker

for KM1~KM6 and GD1~GD9, a nvar * nloci matrix should be specified, which is coded in (-1, 0, 1) and is allowed to have NA entry

Value

an nobs * 3 matrix, with each row being the label of varieties assigned to that farmer

Examples

1
2
3
4
5
6
7
#use alpha design
expDesign(120, 245, method = 'alpha')

#use GD2
data(marker)
M = marker[sample(368, 120), ] #the marker matrix
expDesign(120, 245, method = 'GD2', marker = M)

shuxiaoc/agRank documentation built on May 29, 2019, 9:27 p.m.