Using the output of melt_mip_data, missing values are imputed by applying a summary function to the non NA values for a locus. The default summary function takes the mean of the non NA samples.

impute_mip_data(dat, FUN = mean, ...)

Arguments

dat

output of melt_mip_data

FUN

function to impute missing values. Default = `mean`

...

other arguments to pass to FUN.

Value

Invisibly returns the mip data frame with missing values imputed

Examples

dat <- data.frame( "Sample_ID" = c(rep("a", 3), rep("b", 2)), "Chrom" = c(1, 1, 2, 1, 1), "Pos" = c(100, 200, 50, 100, 200), "Coverage" = c(47, 95, 100, 52, 100), "Barcode_Count" = c(47, 0, 40, 52, 70) ) dat <- melt_mip_data(dat = dat) dat <- impute_mip_data(dat = dat)