Learn R Programming

tawny.types (version 1.0.2)

create.EquityIndex: Create an EquityIndex object

Description

A wrapper around equity indices.

Usage

create.EquityIndex(T, ticker = "^GSPC", hint = NA, src = "yahoo")

Arguments

T
EquityIndex
ticker
The ticker representing the index
hint
Used to determine number of elements in index for paging
src
Placeholder for data source. Currently only supports yahoo

Value

  • An EquityIndex object

    TODO: Consolidate with BenchmarkPortfolio

Details

This type takes an index and will download all constituent returns (assuming the index composition exists). This uses quantmod as a back-end.

Examples

Run this code
# This is run automatically in the package
  tawny.types:::.init()

  index <- create(EquityIndex)

Run the code above in your browser using DataLab