Julia voor gevorderden
Anthony Markham
Quantitative Developer
Redenen om dit te doen:
Twee Julia-pakketten bieden dit: PythonCall en RCall.
using Pkg
Pkg.add("PythonCall")
Pkg.add("RCall")
PythonCall om Python-functies in Julia te gebruiken.using PythonCall
pyimport om een Python-pakket te laden.pytime = pyimport("time")
using PythonCall
pytime = pyimport("time")
println(pytime.ctime())
Sun Jan 22 12:16:28 2023
println(pytime.strftime("%m-%Y", pytime.localtime()))
01-2023
RCall om R-functies in Julia te gebruiken.RCall installeert.using RCall
@rimport om een R-pakket te laden.@rimport base
@rimport ggplot2
using RCall
@rimport base as r_base
r_base.sum([1, 2, 3, 4, 5])
RObject{IntSxp}
[1] 15
RObject{IntSxp}
[1] 15

r_base.abbreviate(["Anthony", "Rachel", "Steve", "Julia"], 3)
RObject{StrSxp}
Anthony Rachel Steve Julia
"Ant" "Rch" "Stv" "Jul"

Julia voor gevorderden