Can I run R parallel computing along side JuliaCall?

Viewed 49

I have an R function code that runs with JuliaCall. However, due to the computation time, I would like to parallel compute my code. My code below produces an error that the Distributions and PoissonRandom packages in Julia do not exist even though the package has already been installed. My question: is it possible to run the parallel package, JuliaCall, and Julia packages?

two_part_sim_RTLs <- function(station_data){
julia_setup(JULIA_HOME = "C:/Users/Kenneth Kin Pomeyie/AppData/Local/Programs/Julia-1.6.1/bin/")

julia_library("Distributions")
  julia_library("DataFrames")
  julia_library("PoissonRandom")

lambda = station_data$lambda
  location = station_data$location
  scale = station_data$scale
  shape = station_data$shape


julia_assign("lambda", lambda)
  julia_assign("location", location)
  julia_assign("scale", scale)
  julia_assign("shape", shape)


julia_eval("x = rand(Truncated(Poisson(lambda), 0.0, 10), 50000000)")
  julia_eval("load = Array{Float64}(undef, 50000000)")
  julia_eval("
 for i in 1:50000000
 load[i] = max(rand(GeneralizedPareto(location, scale, shape)), x[i])
 end
 ")

  load = julia_eval("load")
   
}
0 Answers
Related