[R-SIG-Finance] Quantmod Yahoo ticker download error

Joshua Ulrich josh.m.ulrich at gmail.com
Tue Feb 24 16:21:40 CET 2015


On Tue, Feb 24, 2015 at 9:16 AM, Isak Engdahl <isak.engdahl at gmail.com> wrote:
> Hello Erol,
>
> Thank your for your help!
>
> When I run it with lenght I get the below error:
>
> *Error in symbols[i, ] : incorrect number of dimensions*
> *> *
>
> Any ideas?
>
Read "An Introduction to R".  Your issue is the lack of a basic
understanding of core R data structures.  This is not the correct
forum to ask for help with this type of issue.  As the footer on every
message sent to this list says, in part, "Also note that this is not
the r-help list where general R questions should go."

> //Isak
>
> # Loop through each symbol
> nrow(symbols)
> for (i in 1:length(symbols)){
>   symbol <- symbols[i,]$Symbol
>   df = data.frame(Date=index(get(symbol)), coredata(get(symbol)))
>   setNames(df,c("Date","Open","High","Low","Close","Volume","Adjusted"))
>
>   if(dbExistsTable(con, symbol)){
>     dbRemoveTable(con, symbol)
>   }
>   dbWriteTable(con, name=symbol, value=df, row.names=FALSE, overwrite =
> TRUE)
> }
>
>
>
> On Tue, Feb 24, 2015 at 4:10 PM, Erol Biceroglu <EBiceroglu at optrust.com>
> wrote:
>
>>  I don’t think you can use “nrow()” since it’s a character vector, you
>> need “length()”
>>
>>
>>
>> *Erol Biceroglu, MFin*
>>
>> Senior Risk Analyst
>>
>> *OPSEU Pension Trust*
>>
>> P: 416-681-2707   F: 416-681-6175
>>
>> e: EBiceroglu at OPTrust.com
>>
<snip>
>
>
> --
>
>
> Kind Regards
> Isak Engdahl
>
>         [[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.



-- 
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com



More information about the R-SIG-Finance mailing list