[R] fImport - yahooKeystats

Makwana makwana79 at yahoo.com
Wed Apr 14 23:12:04 CEST 2010

I have written a simple querty where I am trying to download all Keystats for
NASDAQ tickers using the following code:- 

library (fImport) 
library (Matrix) 

#reading csv list of NASDAQ tickers into matrix; 
x = read.csv(file = "C:\\D
Drive\\UChicago\\SV_Project\\Matlab\\list.csv",head = F, sep= ','); 

#Matrix initialization 

# loop to automate datapull of all NASDAQ tickers; 
for (i in 1:3048) 
        #y = matrix(,50,3050) 
        y[,i] = (yahooKeystats(x[i,1])) 

The error I keep getting is:- 

 in `[<-.data.frame`(`*tmp*`, , i, value = list(Value = c(13L, 22L,  : 
  replacement element 1 has 44 rows, need 45 
In addition: Warning messages: 
1: In `[<-.data.frame`(`*tmp*`, , i, value = list(Value = c(27L, 19L,  : 
  replacement element 1 has 48 rows to replace 45 rows 
2: In `[<-.data.frame`(`*tmp*`, , i, value = list(Value = c(42L, 18L,  : 
  replacement element 1 has 46 rows to replace 45 rows 

Can someone suggest a better way to write this code and output in a flat
file where I can have [total Metrics * Total Number of tickers]. 

Thanks in advance. 
View this message in context: http://n4.nabble.com/fImport-yahooKeystats-tp1840454p1840454.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list