Documentation

jl() methods vs jl environment

jl() methods

jl() method for executing julia code

jl() method as conversion from R to julia

jl environment

When installing the jl4R package, the jl variable is automatically created in the global environment.

jl environment
jl$a <- c(1,3,2)
length(jl$a)
names(jl)
jl$a[2]
jl$a
jl$b <- data.frame(aa=1:4,bb=TRUE,cc=c("toto","titi","toto","titi"),stringsAsFactors=TRUE)
jl$b
names(jl$b)
jl$b$cc
jlcall("levels",jl$b$cc)
jl[[levels]](jl$b$cc)
jl[[levels]](`b[!,:cc]`)
class(jl$b$cc)
levels(jl$b$cc)
names(jl)
R> jl$a <- c(1,3,2)
R> length(jl$a)
[1] 3
R> names(jl)
[1] "Dyndoc" "Ruby"   "a"      "b"     
R> jl$a[2]
3.0
R> jl$a
3-element Vector{Float64}:
 1.0
 3.0
 2.0
R> jl$b <- data.frame(aa=1:4,bb=TRUE,cc=c("toto","titi","toto","titi"),stringsAsFactors=TRUE)
R> jl$b
4×3 DataFrame
 Rowaa     bb    ccInt64  Bool  Cat…
─────┼───────────────────
   11  true  toto
   22  true  titi
   33  true  toto
   44  true  titi
R> names(jl$b)
[1] "aa" "bb" "cc"
R> jl$b$cc
4-element CategoricalArray{String,1,UInt32}:
 "toto"
 "titi"
 "toto"
 "titi"
R> jlcall("levels",jl$b$cc)
2-element Vector{String}:
 "titi"
 "toto"
R> jl[[levels]](jl$b$cc)
2-element Vector{String}:
 "titi"
 "toto"
R> jl[[levels]](`b[!,:cc]`)
2-element Vector{String}:
 "titi"
 "toto"
R> class(jl$b$cc)
[1] "CategoricalArray" "jlvalue"         
R> levels(jl$b$cc)
2-element Vector{String}:
 "titi"
 "toto"
R> names(jl)
[1] "Dyndoc" "Ruby"   "a"      "b"

jl$<var> and jl<var>$<-

jl[<meth>]

Conversions R to julia

vector to Array

list to Tuple and named list to NamedTuple

factor to CategoricalArray

data.frame to DataFrame

Conversions julia to R

Array to vector or list

Tuple or NamedTuple to list

Dict to list

`Struct to list

CategoricalArray to factor

DataFrame to data.frame