Mark numeric columns with near zero values from a dataset
by changing the class from numeric
to scientific
.
Usage
mark_near_zero_columns(
curve_summary,
dilution_summary = lifecycle::deprecated(),
threshold_value = 0.01
)
Arguments
- curve_summary
The summary table generated by function
summarise_curve_table()
and/orevaluate_linearity()
but it can also be any generic data frame or tibble.- dilution_summary
- threshold_value
A small cut off value such that any numeric column with a number smaller than this value will be given the class scientific. Default: 0.01
Value
A data frame or tibble with the class with numeric columns with near zero values changed from numeric to scientific.
Details
We mark these columns as scientific so that openxlsx
can
output these columns n scientific notations.
Examples
r_corr <- c(
0.951956, 0.948683, 0.978057, 0.976462,
0.970618, 0.969348, 0.343838, 0.383552
)
pra_linear <- c(
65.78711, 64.58687, 90.21257, 89.95473,
72.91220, 72.36528, -233.05949, -172.13659
)
mandel_p_val <- c(
2.899006e-07, 7.922290e-07, 2.903365e-01, 3.082930e-01,
3.195779e-08, 6.366588e-08, 3.634004e-02, 1.864090e-02
)
concavity <- c(
-4133.501328, -4146.745747, -3.350942, -3.393617,
0.3942824, 0.4012963, -19.9469621, -22.6144875
)
curve_summary <- data.frame(
r_corr = r_corr, pra_linear = pra_linear,
mandel_p_val = mandel_p_val,
concavity = concavity
)
curve_summary <- mark_near_zero_columns(curve_summary)
print(curve_summary, width = 100)
#> r_corr pra_linear mandel_p_val concavity
#> 1 0.951956 65.78711 2.899006e-07 -4133.5013280
#> 2 0.948683 64.58687 7.922290e-07 -4146.7457470
#> 3 0.978057 90.21257 2.903365e-01 -3.3509420
#> 4 0.976462 89.95473 3.082930e-01 -3.3936170
#> 5 0.970618 72.91220 3.195779e-08 0.3942824
#> 6 0.969348 72.36528 6.366588e-08 0.4012963
#> 7 0.343838 -233.05949 3.634004e-02 -19.9469621
#> 8 0.383552 -172.13659 1.864090e-02 -22.6144875