#' conversion between decimal and binary
#'
#' \code{bin2dec(x)} converts binary to decimal
#'
#' @param x is a number
bin2dec <- function(x){
x <- as.character(x)
b <- as.numeric(unlist(strsplit(x, "")))
pow <- 2 ^ ((length(b) - 1):0)
sum(pow[b == 1])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.