create.dynamic.data {tradeCosts} | R Documentation |
This function requires two vectors: period, id. It combines these two vectors and optional vectors into a single data.frame ready for use in the trade.costs function.
create.dynamic.data(period, id, ...)
period |
The column of periods in which trades occured. |
id |
The column of security identifiers traded. |
... |
Additional vector arguments of the same length to be incorporated into the resulting data frame |
This helper function makes creating a dynamic data.frame easier.
A data.frame is returned for use in the trade.costs function.
Daniel Suo
data(dynamic.mar.2007) create.dynamic.data(dynamic.mar.2007$period, dynamic.mar.2007$id, dynamic.mar.2007$vwap)