Hi,

Is something like this what you're after:

download.file("http://uk.old.finance.yahoo.com/d/quotes.csv?s=@%5EFTAI&f=sl1d1t1c1ohgv&e=.csv","C:/Users/Admin/Documents/AIM.csv" , "auto", quiet = FALSE, mode = "w", cacheOK = TRUE)

dledStocks=read.table("C:/Users/Admin/Documents/AIM.csv", header=FALSE, sep=",")

This will download the AIM list in the U.K., go to Yahoo any find the S&P500 list and do the same thing, then you can put the list into a table and do your analysis on it.



--- On Sun, 11/22/09, FX Going <fxongoing@hotmail.com> wrote:

From: FX Going <fxongoing@hotmail.com>
Subject: [R-SIG-Finance] How can I retrieve list of all companies listed of a given Index say S&P 500
To: r-sig-finance@stat.math.ethz.ch
Date: Sunday, November 22, 2009, 4:18 AM


Hey Folks,I understand I could grab list of all companies listed on S&P 500 from wikipedia http://en.wikipedia.org/wiki/List_of_S&P_500_companies 
However what I am looking for is a function whose input is a User specified an Index {better yet, a list of indexes}..For each of the index, The function should be able to retrieve companies listed on that index alongwith their symbols  and dump into a flat file/database.. 
Is there a function in R metrics or fImport You know  that can do the same.. If not , no problem, I guess I will write a function :-)..but before putting the effort just wanted to check if one already exists then I could use it.Thanksfoxonie.                              
_________________________________________________________________


ID24727::T:WLMTAGL:ON:WL:en-US:WWL_WIN_myidea:112009
    [[alternative HTML version deleted]]

_______________________________________________
R-SIG-Finance@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.



      
	[[alternative HTML version deleted]]

