number_of_features: Number of features

Description Usage Arguments Value Examples

Description

Extract the number of features in an object.

Usage

1
2
3
4
5
6
7
number_of_features(x)

## S4 method for signature 'ProjectProblem'
number_of_features(x)

## S4 method for signature 'OptimizationProblem'
number_of_features(x)

Arguments

x

ProjectProblem or OptimizationProblem object.

Value

integer number of features.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# load data
data(sim_projects, sim_features, sim_actions)

# build problem with default solver
p <- problem(sim_projects, sim_actions, sim_features,
             "name", "success", "name", "cost", "name") %>%
     add_max_richness_objective(budget = 200) %>%
     add_binary_decisions() %>%
     add_default_solver()

# print problem
print(p)

# print number of features
number_of_features(p)

oppr documentation built on May 12, 2021, 1:07 a.m.