impute {omicsTools}R Documentation

Impute function

Description

This function performs data cleaning and imputation on a given data matrix. It removes blank and NIST samples, features with NA values more than the specified threshold, and imputes remaining NA values with half of the smallest non-NA value.

Usage

impute(data, percent = 0.2)

Arguments

data

A data frame containing the sample data. The first column should contain the sample identifiers, and the rest of the columns contain the peaks.

percent

A numeric value between 0 and 1 representing the threshold of the percentage of NA values a feature should have for it to be removed from the dataset. Default value is 0.2.

Value

A data frame with the first column as the sample identifiers and the rest of the columns containing the cleaned and imputed peak intensities.

Author(s)

Yaoxiang Li yl814@georgetown.edu

Georgetown University, USA

License: GPL (>= 3)

Examples


# Load the CSV data
data_file <- system.file("extdata", "example1.csv", package = "omicsTools")
data <- readr::read_csv(data_file)
# Apply the impute function
imputed_data <- omicsTools::impute(data, percent = 0.2)


# Write the imputed data to a new CSV file
readr::write_csv(imputed_data, paste0(tempdir(), "/imputed_data.csv"))


[Package omicsTools version 1.0.5 Index]