I would like to run an R function from a script in Julia. I am able to do the reverse, call a Julia function in R, by do the following:
library(JuliaCall)
julia_source(“bin/julia_function.jl”) which has a function “juliaFunction”.
out <- julia_call(“juliaFunction”, input1, input2)
However, I couldn’t figure out how to call an R function from within Julia. It is not a function from a library, which I know can be called using RCall package.
As an example, in fun.R
my_function <- function(fname) {
paste(fname, “Griffin”)
}
Then in a Julia script I would like to call my_function. How would I do that?
Also, I would like to be able to call the Julia script from command line so wouldn’t want to use the R REPL mode.
Thanks in advance.
Tried RCall and include(“fun.R”) but neither are what I need.
Sahar Alkhairy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.