50% off: Unlimited data and AI learning.
State of Data and AI Literacy Report 2025

OpasnetUtils (version 1.1.0)

Optimize: Simple optimization between discrete index locations

Description

Finds the minimal value of an ovariable along given indices. Returns sought rows and drops the rest.

Usage

Optimize(...)
Minimize(data, indices)

Arguments

...
arguments passed to Minimize
data
ovariable or data.frame of suitable format (must contain a "Result" column)
indices
character vector of index names meant to be retained (tapply INDEX)

Value

  • Returns a data.frame which is a subset of the original data.frame or ovariable@output.

Details

Uses tapply and which.min.

Examples

Run this code
a <- Ovariable(output = data.frame(A = letters[c(1,1,2,2)], B = c(1,2,1,2), Result = 1:4))
Minimize(a, "B")
Minimize(a, "A")

Run the code above in your browser using DataLab