Skip to contents

A function to replace NA in the data frame by the half minimum values.

Usage

impute_halfmin(missdf)

Arguments

missdf

a data frame with missing values to be imputed containing features in columns and samples in rows.

Value

A data.frame with imputed values by half-minimum

method.

Examples

data(sim_miss)
impute_halfmin(sim_miss)
#>             X1         X2         X3           X4          X5         X6
#> 1  0.155050833 0.88115677 0.09378121 1.194841e-01 0.600405471 0.01604091
#> 2  0.968378809 0.60748407 0.63377903 6.181195e-01 0.008132938 0.75207300
#> 3  0.468263086 0.57452956 0.24760893 9.408675e-05 0.370125689 0.01604091
#> 4  0.776819652 0.80313329 0.55133933 1.459775e-01 0.724248714 0.84777606
#> 5  0.407885741 0.79911692 0.23476108 1.897136e-01 0.418270750 0.70873497
#> 6  0.538797149 0.80186265 0.25861469 5.754945e-01 0.238248518 0.01604091
#> 7  0.830082966 0.75207300 0.95288810 1.881735e-04 0.887881226 0.48833525
#> 8  0.187103555 0.57546133 0.85687457 3.283283e-01 0.577775384 0.34722847
#> 9  0.779969688 0.94421829 0.09378121 7.827804e-02 0.739950257 0.20304801
#> 10 0.193943927 0.21898736 0.55452418 6.041722e-01 0.160679622 0.73995026
#> 11 0.434231178 0.47799791 0.87694381 3.267991e-01 0.529571799 0.89369752
#> 12 0.002274518 0.04466879 0.80186265 7.904526e-01 0.574529562 0.57452956
#> 13 0.834692139 0.16848571 0.54673734 8.300830e-01 0.960086967 0.08444870
#> 14 0.001137259 0.36828087 0.23275320 8.100511e-01 0.398616886 0.14825833
#> 15 0.956967818 0.56331137 0.60226778 2.027530e-01 0.408468068 0.37028128
#> 16 0.948497073 0.02233439 0.71253911 5.060450e-01 0.613321482 0.86117762
#> 17 0.600729976 0.73432757 0.64890360 5.206680e-01 0.706590850 0.83668180
#> 18 0.261807405 0.70365677 0.18756242 8.426808e-02 0.799116918 0.74054705
#> 19 0.643034251 0.73682406 0.23839289 2.687654e-01 0.161331222 0.98576580
#> 20 0.526233507 0.02233439 0.09378121 8.147157e-01 0.885932416 0.03208182