<- dplyr::tibble(num = c(10^(-1:2), 0, 0, 10^(4:6)))
tbl
tbl
# A tibble: 9 × 1
num
<dbl>
1 0.1
2 1
3 10
4 100
5 0
6 0
7 10000
8 100000
9 1000000
sub_zero()
functionLet’s generate a simple, single-column tibble that contains an assortment of values that could potentially undergo some substitution.
# A tibble: 9 × 1
num
<dbl>
1 0.1
2 1
3 10
4 100
5 0
6 0
7 10000
8 100000
9 1000000
With this table, the zero values in will be given replacement text with a single call of sub_zero()
.