Skip to main content
Bumped by Community user
Bumped by Community user
Tweeted twitter.com/StackQuant/status/1018556298168885248
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user

Using the quantmod package in R, one can download the S&P500 index using the following command:

getSymbols("^GSPC", env = sp500, src = "yahoo",from = as.Date("1960-01-04"), to = as.Date("2009-01-01"))getSymbols("^GSPC", env = sp500, src = "yahoo",from = as.Date("1960-01-04"), to = as.Date("2009-01-01"))

The S&P is further broken down in sectors (with their yahoo symbols in brackets): Health care (XLV), industrials (XLI), consumer staples (XLP), consumer discretionary (XLY), materials (XLB), utilities (XLU), financials (XLF or XLFS), energy (XLE), technology (XLK), and Real Estate (XLRE).

These sectors are further broken down in subsectors, but I do not know how to get these indexes. For example, Healtcare is has Managed care, Pharmaceuticals, equipment, as subsectors. For
For example,

http://finance.yahoo.com/quote/%5ESP500-3510?p=%5ESP500-3510

is a subsector of the Health care index, but using the symbol given there (^SP500-3510) does not seem to work in the above getSymbolgetSymbol R command. Any suggestion on how to get this index?

Using the quantmod package in R, one can download the S&P500 index using the following command:

getSymbols("^GSPC", env = sp500, src = "yahoo",from = as.Date("1960-01-04"), to = as.Date("2009-01-01"))

The S&P is further broken down in sectors (with their yahoo symbols in brackets): Health care (XLV), industrials (XLI), consumer staples (XLP), consumer discretionary (XLY), materials (XLB), utilities (XLU), financials (XLF or XLFS), energy (XLE), technology (XLK), and Real Estate (XLRE).

These sectors are further broken down in subsectors, but I do not how to get these indexes. For example, Healtcare is has Managed care, Pharmaceuticals, equipment, as subsectors. For example,

http://finance.yahoo.com/quote/%5ESP500-3510?p=%5ESP500-3510

is a subsector of the Health care index, but using the symbol given there (^SP500-3510) does not seem to work in the above getSymbol R command. Any suggestion on how to get this index?

Using the quantmod package in R, one can download the S&P500 index using the following command:

getSymbols("^GSPC", env = sp500, src = "yahoo",from = as.Date("1960-01-04"), to = as.Date("2009-01-01"))

The S&P is further broken down in sectors (with their yahoo symbols in brackets): Health care (XLV), industrials (XLI), consumer staples (XLP), consumer discretionary (XLY), materials (XLB), utilities (XLU), financials (XLF or XLFS), energy (XLE), technology (XLK), and Real Estate (XLRE).

These sectors are further broken down in subsectors, but I do not know how to get these indexes. For example, Healtcare is has Managed care, Pharmaceuticals, equipment, as subsectors.
For example,

http://finance.yahoo.com/quote/%5ESP500-3510?p=%5ESP500-3510

is a subsector of the Health care index, but using the symbol given there (^SP500-3510) does not seem to work in the above getSymbol R command. Any suggestion on how to get this index?

Bumped by Community user
Bumped by Community user
Bumped by Community user