Skip to contents

The function prepare_calendar_cost() creates a matrix that can be used as the 'cost' slot of a Calendar object.

Usage

prepare_calendar_cost(action, horizon)

Arguments

action

data.frame describing a set of actions

horizon

integer vector giving the time horizon (in years)

Value

A matrix which rows corresponds to years as given by horizon and one column giving total costs.

Details

project shoudl be a data.frame with a format consistent with the one of slot poject of Case objects. The function can be called with a project with only an unique project. This is how it is expected to work when called from calendar() function. It can also be called with a project with several projects. In this case, project is first split by project and the function is recursively called.

action is a data.frame of actions. There may be too much actions, i.e. actions that are not used by the given project but not too few.

horizon is necessary as this information is missing in project and action.

Author

Frédéric Grelot, frederic.grelot.1994_cran@m4x.org