[R-SIG-Finance] Process used to manage workspace and large data files

s algotr8der at gmail.com
Sat May 14 18:08:19 CEST 2011


Thank you Garrett and Brian. I will take a look.

In the mean time I just saved one of my symbols in mySQL to an rda file.
I want to be able to retrieve a subset of the data using one of the
getSymbols variants. Is this possible?

For example, the time series for AMKR starts on 2002-04-08. I want to
grab the subset between 2009-01-01 and end of day 2010-10-06. It appears
the entire object is loaded. Appreciate the help.

> getSymbols('AMKR', from="2009-01-01 09:31:00", to="2010-10-06
16:00:00", src='rda', col.names=c("open", "high", "low", "close", "volume"))
[1] "AMKR"

> head(AMKR)
                    AMKR.open AMKR.high AMKR.low AMKR.close AMKR.volume
2002-04-08 09:31:00     21.50     21.50    21.42      21.42        7300
2002-04-08 09:32:00     21.41     21.46    21.39      21.40        1100
2002-04-08 09:33:00     21.35     21.35    21.30      21.30         900
2002-04-08 09:34:00     21.37     21.44    21.37      21.43        4100
2002-04-08 09:35:00     21.43     21.43    21.43      21.43         400
2002-04-08 09:36:00     21.43     21.43    21.35      21.37        3200

Or even everything from 2009-01-01 onwards

> getSymbols('AMKR', from="2009-01-01", src='rda', col.names=c("open",
"high", "low", "close", "volume"))

[1] "AMKR"

> head(AMKR)
                    AMKR.open AMKR.high AMKR.low AMKR.close AMKR.volume
2002-04-08 09:31:00     21.50     21.50    21.42      21.42        7300
2002-04-08 09:32:00     21.41     21.46    21.39      21.40        1100
2002-04-08 09:33:00     21.35     21.35    21.30      21.30         900
2002-04-08 09:34:00     21.37     21.44    21.37      21.43        4100
2002-04-08 09:35:00     21.43     21.43    21.43      21.43         400
2002-04-08 09:36:00     21.43     21.43    21.35      21.37        3200

On 5/14/11 12:02 PM, G See wrote:
> You could have different data files for different days, and write a wrapper
> for getSymbols to rbind it all together when you need it. I think
> getSymbols.FI, in the FinancialInstrument package, does this.
>
> On Sat, May 14, 2011 at 8:54 AM, s <algotr8der at gmail.com> wrote:
>
>> Now how do you maintain these rda files as new data arrives each day -
>> is there some way of adding incremental data to the object? For example
>> if I have minute data for QQQ from 2002-01-01 to 2011-05-13 I don't want
>> to pull all of the data beginning 2002-01-01 from my source to update
>> one day's worth of data at the end of business this coming Monday.
>>
>>



More information about the R-SIG-Finance mailing list