I am trying to manipulate data that an analyst has given me. What are 
the best possible libraries? I will have to solve many questions that 
another analyst will ask over time. The first is to compare predictions 
to actual prices. Predictions are made every day for every stock.

For the last five years for each of several markets I have a csv file 
for each year. In each file the data is for 1,000 stocks (approximately) 
and with one entry for each trading day for each stock. So each file may 
have something like 250,000 rows. There are nine columns. To simplify a 
file might look like the following.

DateStockPriceOffsetEPrice

1/4/2011S150.001450.25

1/4/2011S212.682111.95

1/18/2011S150.403551.00

So on January 4, 2011 the analyst predicted that stock S1 would be worth 
50.25 on January 18, 2011.Looking down to the third row of data it turns 
out that stock S1 was worth 50.40 on January 18. I need to put that into 
a new column and in row 1 of the data. I was able to solve this 
particular problem by doing a reflexive join using sqldf. Additionally, 
I have some experience with standard R data manipulation at the level of 
Spector, but I am hoping that there is a library that can help with this 
and other standard tasks.

So the first column is a date field. The second is a character field for 
the stock symbol. The remaining given and derived fields will be numeric.

I did take a look at zoo, but zoo "requires" unique dates.

Suggestions are greatly appreciated.


        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to