[R-SIG-Finance] RMySQL returning too much data?

Mark Knecht markknecht at gmail.com
Tue Jan 7 18:32:42 CET 2014


On Tue, Jan 7, 2014 at 9:16 AM, Joshua Ulrich <josh.m.ulrich at gmail.com> wrote:
> Hi Mark,
>
> On Tue, Jan 7, 2014 at 10:00 AM, Mark Knecht <markknecht at gmail.com> wrote:
>> Using the code attached it appears to me that RMySQL is not paying
>> attention to the from=/to= date ranges the way getSymbols does when
>> going to Yahoo. WIth Yahoo I get the range I requested. With MySQL I
>> seem to get whatever range I have stored in the MySQL database.
>>
> getSymbols.MySQL doesn't have from or to args.
>
>> args(getSymbols.MySQL)
> function (Symbols, env, return.class = "xts", db.fields = c("date",
>     "o", "h", "l", "c", "v", "a"), field.names = NULL, user = NULL,
>     password = NULL, dbname = NULL, host = "localhost", port = 3306,
>     ...)
>
> While they could potentially be added; it's probably more trouble than
> it's worth in this case, since your data aren't that large and you can
> subset after the getSymbols call returns:
> foo[paste0(Date_Start,"/",Date_end)].
>
<SNIP>
> Joshua Ulrich  |  about.me/joshuaulrich
> FOSS Trading  |  www.fosstrading.com

Joshua,
   Thanks very much for the speedy analysis & reply. subsetting the
data is fine in this case and likely to be fine for me for a long time
even if the data is larger.

   It hadn't occurred to me that an input to getSymbols would be
passed to src=yahoo but not to src=MySQL but that's fine now that I
know. It does seem a bit non-intuitive from a design & documentation
POV but I'm happy that it's not a bug. Spend your time designing new,
great stuff and don't mess with this until/unless one day you think it
warrants the time.

Cheers,
Mark



More information about the R-SIG-Finance mailing list