sub_result: Extract Row-wise Subset of a Result Object

View source: R/allgeneric.R

sub_resultR Documentation

Extract Row-wise Subset of a Result Object

Description

This function extracts a row-wise subset of a classification or regression result object.

Usage

sub_result(x, indices)

Arguments

x

The input result object, which should be an instance of a classification or regression result class.

indices

A vector of row indices to extract from the result object.

Value

A new result object containing only the specified row indices from the input result object.

See Also

Other sub_result: sub_result.binary_classification_result(), sub_result.multiway_classification_result()

Examples

# Create a simple classification result object
observed <- c(1, 0, 1, 1, 0)
predicted <- c(1, 0, 0, 1, 1)
result <- list(observed = observed, predicted = predicted)
class(result) <- c("classification_result", "list")

# Extract a subset of the result object
sub_result(result, c(2, 3, 4))

bbuchsbaum/rMVPA documentation built on April 23, 2024, 7:35 a.m.