Learn R Programming

PortfolioAnalytics (version 2.0.0)

extractGroups: Extract the group and/or category weights

Description

This function extracts the weights by group and/or category from an object of class optimize.portfolio. Group constraints or category_labels must be specified for this to return group constraints.

Usage

extractGroups(object, ...)

Value

a list with two elements

weights:

Optimal set of weights from the optimize.portfolio object

category_weights:

Weights by category if category_labels are supplied in the portfolio object

group_weights:

Weights by group if group is a constraint type

Arguments

object

object of class optimize.portfolio

...

passthrough parameters. Not currently used

Author

Ross Bennett