impute_mip_data: Impute missing mip data

Description Usage Arguments Value Examples

View source: R/main.R

Description

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.

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

mrc-ide/mipmapper documentation built on May 20, 2019, 3:27 p.m.