Thank you Milan. Was able to work around based on your comment:
reval("library(\"quantmod\")")
r = reval("getFinancials('GOOGL')")
t = reval("viewFinancials(GOOGL.f, type = 'IS', period = 'Q')")
@rput t
u = rcopy("rownames(t)")
w = rcopy("colnames(t)")
v = @rget t
uf = DataFrame()
uf[:Field_Names] = u
for i=1:length(w)
uf[symbol(w[i])] = v[:,i]
end
uf
On Sunday, September 4, 2016 at 4:22:15 AM UTC-5, Milan Bouchet-Valat wrote:
>
> 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] <javascript:>.
> > 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.