#' Transforming N_PERS to BCSI_ID
#'
#' @param npers An N_PERS to transform to BCSI_ID
#'
#' @return A character string with 10 digit BCSI ID
#' @import stringr
#' @export
#'
#' @examples
#' npers_to_bcsi(0039249861)
#' npers_to_bcsi(39249861)
npers_to_bcsi <- function(npers) {
if(anyNA(as.numeric(npers))) {
warning("npers contains non-numeric characters")
}
npers <- str_pad(npers, side ="left", width = 10, pad = "0")
bcsi <- str_trunc(npers, width = 8, side = "right", ellipsis = "")
bcsi <- str_pad(bcsi, width = 10, side = "left", pad = "0")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.