Skip to contents

This helper function adds the sample name as a column in the feature dataframe. It assumes that the sample name is embedded in the filename, and this function strips unnecessary parts of the filename.

Usage

extract_features(sample_name, feature_data)

Arguments

sample_name

Character. The name of the sample, typically derived from the feature file name.

feature_data

Dataframe. The feature data associated with the sample.

Value

A dataframe with the sample name added as a column.

Examples

if (FALSE) { # \dontrun{
sample_name <- "sample_001_fea_v2.csv"
feature_data <- data.frame(roi_number = 1:10, feature_value = rnorm(10))
result <- extract_features(sample_name, feature_data)
} # }