| sim_chr {Relate} | R Documentation | 
~~ A concise (1-5 lines) description of what the function does. ~~
sim_chr(snp, freq = 0.2, min = 0.5, max = 0.95, k = k, a = 3.854, number_per_cm = 1)
| snp | ~~Describe snphere~~ | 
| freq | ~~Describe freqhere~~ | 
| min | ~~Describe minhere~~ | 
| max | ~~Describe maxhere~~ | 
| k | ~~Describe khere~~ | 
| a | ~~Describe ahere~~ | 
| number_per_cm | ~~Describe number_per_cmhere~~ | 
~~ If necessary, more details than the description above ~~
~Describe the value returned If it is a LIST, use
| comp1  | Description of 'comp1' | 
| comp2  | Description of 'comp2' | 
...
....
~~further notes~~
~Make other sections like Warning with section{Warning }{....} ~
~~who you are~~
~put references to the literature/web site here ~
~~objects to See Also as help, ~~~
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--    or do  help(data=index)  for the standard data sets.
## The function is currently defined as
function (snp, freq = 0.2, min = 0.5, max = 0.95, k = k, a = 3.854, 
    number_per_cm = 1) 
{
    hap11 <- unrelated(snp, freq, min, max)
    hap12 <- unrelated(snp, freq, min, max)
    hap21 <- unrelated(snp, freq, min, max)
    hap22 <- unrelated(snp, freq, min, max)
    pos <- as.integer(rnorm(snp, mean = CM, sd = CM/10))
    pos <- round(pos/number_per_cm, 0)
    pos <- cumsum(pos)
    state = recom(pos/CM, k = k, a = a)
    hap11[state == 2] <- hap21[state == 2]
    hap12[state == 2] <- hap22[state == 2]
    hap11[state == 1] <- hap21[state == 1]
    geno <- cbind(hap11 + hap12, hap21 + hap22)
    obs <- list(geno = geno, state = state, k = k, a = a, freq = freq, 
        number_per_cm = number_per_cm, min = min, max = max, 
        snp = snp, pos = pos)
    class(obs) = "sim_chr"
    return(obs)
  }