feature_manipulation: feature_manipulation - Manipulate features in a matrix or...

View source: R/feature_manipulation.R

feature_manipulationR Documentation

feature_manipulation - Manipulate features in a matrix or data frame

Description

This function allows for manipulation of features in a given matrix or data frame. It can remove variables with missing values, non-numeric variables, infinite variables, and variables with zero standard deviation.

Usage

feature_manipulation(data, feature, is_matrix = FALSE, print_result = FALSE)

Arguments

data

The matrix or data frame containing the features to be manipulated.

feature

The features to be manipulated. If is_matrix is set to TRUE, feature will be ignored.

is_matrix

Whether the data is in matrix format. Default is FALSE. If set to TRUE, the function will treat data as a matrix and extract the column names as features.

print_result

Whether to print the manipulation results. Default is FALSE. If set to TRUE, it will print the results of each manipulation step.

Value

filtered features

Author(s)

Dongqiang Zeng

Examples

# loading data
data("eset_stad")
# filtering features with NA or outlier
feas <- feature_manipulation(data = eset, feature = rownames(eset), is_matrix = TRUE)

IOBR/IOBR documentation built on April 4, 2024, 1:07 a.m.