[R-SIG-Finance] Does getSymbols.csv() take a "format" argument?

G See gsee000 at gmail.com
Tue Mar 6 17:09:13 CET 2012


saveSymbols will save your data as .RData files.

If you have .RData files, then FinancialInstrument:::getSymbols.FI is
probably a better way to read them as getSymbols.RData is really an
alias for getSymbols.rda which causes problems because the "rda"
extension is hardcoded in a couple places.

If you want to save your data as RData or rda files, then the
functions saveSymbols.days and saveSymbols.common (also from the
FinancialInstrument package) may be better solutions... at least they
don't require that the data were read using getSymbols.

HTH,
Garrett

On Tue, Mar 6, 2012 at 9:53 AM, Jeffrey Ryan <jeffrey.ryan at lemnica.com> wrote:
> I'll take a look at improving the getSymbols.csv, but the general
> notion of quantmod is as a framework to extend to the data *you* have,
> not provide complete coverage for all possible scenarios.
>
> That said, I'll see what can be modified to make things more robust.
> Thanks for the suggestions.
>
> Best,
> Jeff
>
> On Tue, Mar 6, 2012 at 9:47 AM, Stergios Marinopoulos
> <stergios_marinopoulos at yahoo.com> wrote:
>> Hi Ross,
>>
>> Thanks for the alternative ideas.  While I did manage to get the csv loaded properly by looking at the source code to getSymbols.csv(), my primary motivation for posting the bug report was to help improve the quantmod package by offering feedback.  One of the downsides of getSymbols.csv() not working besides the obvious is that one cannot then use saveSymbols() as it only works with data loaded via getSymbols() ( I think this is enforced via attribute setting in getSymbols() )
>>
>> I'll look into using quantstrat's loading and saving.
>>
>> Thanks again Ross,
>>
>>
>> --
>> Stergios Marinopoulos
>>
>>
>> ________________________________
>>  From: Ross Bennett <rossbennett34 at gmail.com>
>>
>> Cc: r-sig-finance at r-project.org
>> Sent: Tuesday, March 6, 2012 6:29 AM
>> Subject: [R-SIG-Finance] Does getSymbols.csv() take a "format" argument?
>>
>>
>> Stergios,
>>
>> Saw your question on the R-SIG-Finance mailing list. I use FX pairs in testing that I have saved on my computer and ran into a similar problem. I have found the GetSymbols.csv to be unreliable, as mentioned in the help documentation, to load the data files into R for use in quantstrat.
>>
>> The easiest way to do this is using the read.zoo function
>>
>> My data is stored in a directory such as C:\fxdata\EURUSD.csv
>>
>>
>> Step 1: use read.zoo to load the file into R
>> EURUSDzoo <- read.zoo("C:\\fxdata\\EURUSD.csv", header = TRUE, sep=",", format = '%Y-%m-%d')
>>
>> Step 2: coerce to xts format
>> EURUSD <- as.xts(EURUSDzoo)
>>
>> You could also just do
>> EURUSD <- as.xts(read.zoo("C:\\fxdata\\EURUSD.csv", header = TRUE, sep=",", format = '%Y-%m-%d'))
>>
>> Let me know if this works.
>>
>> Ross
>>        [[alternative HTML version deleted]]
>>
>>
>> _______________________________________________
>> R-SIG-Finance at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only. If you want to post, subscribe first.
>> -- Also note that this is not the r-help list where general R questions should go.
>
>
>
> --
> Jeffrey Ryan
> jeffrey.ryan at lemnica.com
>
> www.lemnica.com
> www.esotericR.com
>
> R/Finance 2012: Applied Finance with R
> www.RinFinance.com
>
> See you in Chicago!!!!
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.



More information about the R-SIG-Finance mailing list