View source: R/sim_crossing_block.R
sim_crossing_block | R Documentation |
Create a crossing block based on parent names, with different options for mating scheme.
sim_crossing_block(
parents,
n.crosses = NULL,
type = c("2way", "4way"),
scheme = c("random", "chain"),
use.parents.once = FALSE
)
parents |
A |
n.crosses |
The number of crosses to generate. Cannot be more than the possible number of crosses. If NULL, the function returns all possible crosses. |
type |
The type of crosses to simulate. Can be |
scheme |
The mating scheme. Can be one of |
use.parents.once |
|
Several options are available to generate crossing blocks from a list of parents. Here are the rules used for generating different crossing blocks.
scheme = "random"
A data.frame
is first constructed with
all possible pairwise combinations of parents
. Self-crosses and reciprocal
crosses are removed and n.crosses
crosses are randomly sampled. If
use.parents.once = TRUE
, crosses are selected such that any one parent
is used only once.
scheme = "chain"
Crosses are generated by pairing the first element
in parents
with the second element, the second element with the third,
and so on. The n.crosses
and use.parents.once
arguments are ignored.
Further rules:
If second.parents = NULL
, then parents
is duplicated.
A data.frame with two columns. The first is the names of the first parents, and the second is the name of the second parents. Each row is a mating pair.
parents <- paste("line", seq(10), sep = "")
# Generate 3 crosses randomly
cb <- sim_crossing_block(parents = parents, n.crosses = 3)
# Generate 3 crosses randomly, while using parents only once.
cb <- sim_crossing_block(parents = parents, n.crosses = 3, use.parents.once = TRUE)
# Generate a chain of crosses
cb <- sim_crossing_block(parents = parents, scheme = "chain")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.