1

I would like to import the Julia array including unit range below to R:

Any[1:6, 9, 12, 15]

What I exactly want is something equivalent to this in R:

c(1:6, 9, 12, 15)

Any help will be appreciated.

weera
  • 884
  • 1
  • 10
  • 21

1 Answers1

1
R"b <- $(collect(flatten(a)))"

Setup:

using Base.Iterators
a = [1:6, 9, 12, 15]

Testing

julia> R"b <- $(collect(flatten(a)))"
RObject{IntSxp}
[1]  1  2  3  4  5  6  9 12 15

Please also note that the Julian equivalent of c(1:6, 9, 12, 15) is:

julia> [1:6..., 9, 12, 15]
9-element Array{Int64,1}:
  1
  2
  3
  4
  5
  6
  9
 12
 15
Przemyslaw Szufel
  • 40,002
  • 3
  • 32
  • 62