Le samedi 03 septembre 2016 à 15:43 -0700, Reuben a écrit :
> HI,
> 
> I am trying to use the quantmod "getFinancials" and "viewFinancials"
> functions to easily get financial statements into julia.
> 
> using RCall, DataFrames
> 
> reval("library(\"quantmod\")")
> 
> r= reval("getFinancials('GOOGL')")
> 
> t = reval("viewFinancials(GOOGL.f, type = 'IS', period = 'Q')")
> 
> When I all do this in a julia notebook, get a decent looking table of
> what i am looking for: https://www.dropbox.com/s/uqd42wm4jwq8mz3/Scre
> enshot%202016-09-03%2017.41.20.png?dl=0
> 
> However, when I try to display this information in a julia dataframe,
> i just end up with a collection of julia arrays: https://www.dropbox.
> com/s/taobxhqc26jc7tk/Screenshot%202016-09-03%2017.42.15.png?dl=0
> 
> Perhaps the issue is the R dataframe not being exactly in the format
> Julia is expecting; I'm not familiar with the R side much. The data
> is there, this is basically working, but it would be nice to get a
> full fledged Julia DataFrame with proper row labels.
Indeed, the result of viewFinancials() is not a data.frame, but a
matrix with names. Looks like names are currently not preserved, I've
file an issue:
https://github.com/JuliaStats/RCall.jl/issues/144

As a workaround, you can convert the results to a data.frame before
passing them to Julia. Though you also need to move the row names into
a column to preserve them:
rcopy("cbind(Names=rownames(t), as.data.frame(t))")


Regards


> -Reuben
> -- 
> You received this message because you are subscribed to the Google
> Groups "julia-stats" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to