Skip to content
Prev 8881 / 15274 Next

Keeping persistent data collections

I do what Brian described, and I use a couple functions from
FinancialInstrument to do it.

library(FinancialInstrument)
?saveSymbols.days
?saveSymbols.common
?getSymbols.FI

(I just noticed that those 2 saveSymbols.* functions do not allow for a
data extension other
than the old .rda.  I will probably update that today.)

I put together a little example, which I'll attach as well as paste below.

This is how I do it, but I certainly encourage suggestions for improvement.

HTH,
Garrett
AAA
2011-10-31 09:04:00  0.05152989
2011-10-31 09:05:00  0.12797379
2011-10-31 09:06:00  0.96025183
2011-10-31 09:07:00 -0.23265907
2011-10-31 09:08:00  1.77706849
2011-10-31 09:09:00 -1.29139344
Open     High      Low    Close
2007-01-02 50.03978 50.11778 49.95041 50.11778
2007-01-03 50.23050 50.42188 50.23050 50.39767
2007-01-04 50.42096 50.42096 50.26414 50.33236
2007-01-05 50.37347 50.37347 50.22103 50.33459
2007-01-06 50.24433 50.24433 50.11121 50.18112
2007-01-07 50.13211 50.21561 49.99185 49.99185
from='2011-10-31')
[1] "AAA"
[1] "DDD"
AAA
2011-10-31 09:04:00  0.05152989
2011-10-31 09:05:00  0.12797379
2011-10-31 09:06:00  0.96025183
2011-10-31 09:07:00 -0.23265907
2011-10-31 09:08:00  1.77706849
2011-10-31 09:09:00 -1.29139344
Open     High      Low    Close
2007-01-02 50.03978 50.11778 49.95041 50.11778
2007-01-03 50.23050 50.42188 50.23050 50.39767
2007-01-04 50.42096 50.42096 50.26414 50.33236
2007-01-05 50.37347 50.37347 50.22103 50.33459
2007-01-06 50.24433 50.24433 50.11121 50.18112
2007-01-07 50.13211 50.21561 49.99185 49.99185
[1] "DDD"
split_method='days'))
[1] "AAA"
[1] "AAA"

        
On Mon, Nov 7, 2011 at 3:20 AM, Brian G. Peterson <brian at braverock.com>wrote:

            
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20111107/dc8ee49e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Rdatasaving.R
Type: text/x-r-source
Size: 1208 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20111107/dc8ee49e/attachment.bin>