EAGeneratorBinary = function(n, d) {
EAGenerator$new(
name = "Binary generator",
params = list(n = n, d = d),
representations = "binary",
fun = function(n, d) {
genPopBin(n, d)
}
)
} # EAGeneratorBinary
#' @title Sample random bitstring
#'
#' @param n [\code{integer(1)}]\cr
#' Length of bitstring.
#' @return [\code{integer}] Bitstring of length \code{n}.
#' @family individual_generators
#' @rdname individual_generators
#' @name individual_generators
#' @export
genBitstring = function(n) {
sample(c(0L, 1L), size = n, replace = TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.