getConstituents: Load Constituent Data for Indexes

Description Usage Arguments Value Examples

Description

Functions to scrape and clean index constituent data from multiple sources for a given index. Current src methods available are: default. Data is loaded silently without user assignment by default.

Usage

1
2
getConstituents(index, env = .GlobalEnv, simple = TRUE, src = "default",
  auto.assign = TRUE)

Arguments

index

character specifying the name of the index

env

where to create objects. Setting env=NULL is equal to auto.assign=FALSE. Defaults to .GlobalEnv

simple

should results include non-ticker data. If TRUE, returns character vector of index's constituents. If FALSE returns an. Defaults to TRUE

src

character string specifying the source to retrieve the data from. As of 0.1-1, the only source available is "default" which changes depending on the selected index. Defaults to "default"

auto.assign

should results be loaded to env. If FALSE return results. Defaults to TRUE

Value

if auto.assign==FALSE: a character vector of index's constituents

if auto.assign==TRUE: the name of the variable holding the data within the specified environment

Examples

1
2
3
## Not run: 
getConstituents(index='S&P500')
## End(Not run)

alec25/smif documentation built on May 7, 2019, 9:43 p.m.