R/f.rand.geno.R

Defines functions f.rand.geno

## MENDELIAN SELECTION
f.rand.geno <- function(x1, x2){
	## PASTE TOGETHER x1 AND x2, IN RANDOM PERMUTATION
	.rand <- as.logical(rbinom(length(x1), size = 1, prob = 0.5))
	.x1 <- as.character(ifelse(.rand, x1, x2))
	.x2 <- as.character(ifelse(!.rand, x1, x2))
	#.x <- paste(.x1, .x2, sep = " ")
	.x <- cbind(.x1,.x2)
	.x
}

Try the Haplin package in your browser

Any scripts or data that you put into this service are public.

Haplin documentation built on May 20, 2022, 5:07 p.m.