#' wright fishers model copied from somewhere
#'
#' @author Brian Masinde
#'
#'
wright_fisher <- function(N){
# initialize the martrix
P <- matrix(NA, ncol = 2*N + 1, 2*N + 1)
# fill up the matrix
for(i in 0:(2*N)){
for(j in 0:(2*N)){
# add to matrix for examples
P[i+1, j+1] <- dbinom(j, 2*N, (i / (2*N)))
}
}
return(round(P, digits = 2))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.