1

Assume I have a Julia data array like this:

Any[Any[1,missing], Any[2,5], Any[3,6]]

I want to import it to R using RCall so I have an output equivalent to this:

data <- cbind(c(1,NA), c(2,5), c(3,6))

Note: the length of data is dynamic and it may be not 3!

could anyone help me how can I do this? Thank you

weera
  • 884
  • 1
  • 10
  • 21

1 Answers1

3

You can just interpolate a matrix into R:

a = [ 1    2  3
   missing 5  6 ]
R"data <- $a"

To reorgnize your "array of array" into a matrix, you need to concat them

b = Any[Any[1,missing], Any[2,5], Any[3,6]]
a = hcat(b...)
R"data <- $a"
张实唯
  • 2,836
  • 13
  • 25