single_imputation: Single imputation

View source: R/imputation.R

single_imputationR Documentation

Single imputation

Description

Performs a single imputation run and returns the data with NA values replaced by imputed values.

Usage

single_imputation(data, design, id_col = "id")

Arguments

data

a data.frame to perform the imputation on, missing values should be NA.

design

a design or model matrix as produced by model.matrix with column names corresponding to the different conditions.

id_col

a character for the name of the column containing the name of the features in data (e.g., peptides, proteins, etc.).

Value

a data.frame with NA values replaced by imputed values.

Examples

# Generate a design matrix for the data
design <- model.matrix(~ 0 + factor(rep(1:2, each = 3)))

# Set correct colnames, this is important for fit_gamma_weights
colnames(design) <- paste0("ng", c(50, 100))

yeast %>%
  # Normalize and log-transform the data
  psrn("identifier") %>%
  # Run the imputation
  single_imputation(design, "identifier")

PhilipBerg/PaiR documentation built on March 18, 2022, noon