jl() methods vs jl environmentjl() methodsjl() method for executing julia codejl() method as conversion from R to juliajl environmentWhen installing the jl4R package, the jl variable is automatically created
in the global 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 Row │ aa bb cc │ Int64 Bool Cat… ─────┼─────────────────── 1 │ 1 true toto 2 │ 2 true titi 3 │ 3 true toto 4 │ 4 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>]R to juliavector to Arraylist to Tuple and named list to NamedTuplefactor to CategoricalArraydata.frame to DataFramejulia to RArray to vector or listTuple or NamedTuple to listDict to listStruct to listCategoricalArray to factorDataFrame to data.frame