vec <- c(212, 75.38, 4.9625)
# By default, pad to the most decimal places in `vec`:
restore_zeros(vec)
# Or to a given width:
restore_zeros(vec, width = 6)
iris <- tibble::as_tibble(iris)
# All numeric columns, but not the factor:
restore_zeros_df(iris)
# Selected columns:
restore_zeros_df(iris, starts_with("Sepal"), width = 3)
Run the code above in your browser using DataLab