armgong / rjulia

R package which integrating R and Julia
GNU General Public License v2.0
146 stars 23 forks source link

[WIP] representing R list as julia Vector{Any} #38

Closed phaverty closed 8 years ago

phaverty commented 8 years ago

This PR alters R_Julia_MD to return Vector{Any} when given an R list (VECSXP). To make doing so simpler, it also moves the association the new R_Julia_MD array with a julia global symbol to the R_Julia function. This is nice because it allows other functions to call R_Julia_MD without creating and destroying temporary global symbols (like in list or DataFrame creation).

I added tests to the roundtrip tests to check lists too. These tests currently break because the j2r side of this is not yet implemented.

I'd be interested to know if you like this idea of moving the jl_set_global operation out of R_Julia_MD.

I have added return of Vector{Any} as VECSXP.

In a bigger change, I have centralized all of the R array creation to one function and handled the difference between return vectors and arrays there rather than stripping the dims off of 1D arrays later in R.

There are probably a few special types that are not doing the right thing in my code. For example, I just handle int64 as REALSXP rather than trying to see if it will fit in INTSXP (int32).

armgong commented 8 years ago

will try this in weekend ,a big thanks

phaverty commented 8 years ago

Have you had a chance to look a this? I think I'm still missing a few things for the more exotic julia types, but I wanted to pause and get your input before proceeding.

armgong commented 8 years ago

sorry for late, on vacation these days , I will see this in this weekend.

armgong commented 8 years ago

and I think we also need test on julia 0.5 branch, it now in RC.

phaverty commented 8 years ago

​Great, thanks!

Pete


Peter M. Haverty, Ph.D. Genentech, Inc. phaverty@gene.com

On Thu, Jul 28, 2016 at 6:10 PM, Yu Gong notifications@github.com wrote:

sorry for late, on vacation these days , I will see this in this weekend.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/armgong/rjulia/pull/38#issuecomment-236069361, or mute the thread https://github.com/notifications/unsubscribe-auth/AH02K67bNUd6k6iI0LZpRpGNV5t4pxoUks5qaVMjgaJpZM4JBcQd .

phaverty commented 8 years ago

Yes, good point. I'll give 0.5 a try.

Pete


Peter M. Haverty, Ph.D. Genentech, Inc. phaverty@gene.com

On Thu, Jul 28, 2016 at 6:14 PM, Yu Gong notifications@github.com wrote:

and I think we also need test on julia 0.5 branch, it now in RC.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/armgong/rjulia/pull/38#issuecomment-236069870, or mute the thread https://github.com/notifications/unsubscribe-auth/AH02K-1ZFp1BVuO5ECgplR2Ni0MNwdsXks5qaVQFgaJpZM4JBcQd .