Functions for CHI numbers
You can install the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("graemegowans/chi")
Use pad_chi()
to add a leading zero to a 9 character string. Other strings are left alone.
library(chi)
library(tidyverse)
df <- tibble(chi_no = c("123456789", "1234567890", "123"))
df %>% mutate(padded_chi = pad_chi(chi_no))
#> # A tibble: 3 x 2
#> chi_no padded_chi
#> <chr> <chr>
#> 1 123456789 0123456789
#> 2 1234567890 1234567890
#> 3 123 123
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.