simlr_impute.Rd
Impute missing SiMLR data in a specified column based on other columns
simlr_impute(
dataframe,
nms,
vecnum,
toimpute,
separator = "PC",
family = "gaussian"
)
A data frame containing the data to impute.
A vector of base column names.
A numeric value to append to the column names.
The base name of the target column to be imputed.
A string specifying the separator between the column name and feature.
A string specifying the GLM family (default is 'gaussian').
A data frame with imputed values.
set.seed(123)
n=50
df <- data.frame(
t1PC1 = rnorm(n),
t1aPC1 = rnorm(n),
dtPC1 = rnorm(n),
dtaPC1 = rnorm(n),
rsfPC1 = rnorm(n),
perfPC1 = rnorm(n)
)
df[ sample(1:nrow(df),20),6 ]=NA
nms <- c("t1", "t1a", "dt", "dta", "rsf", "perf")
vecnum <- 1
toimpute <- "perf"
df = simlr_impute(df, nms, vecnum, toimpute, family = 'gaussian')