R/setJuliaSeed.R

Defines functions setJuliaSeed

Documented in setJuliaSeed

#' @title Set Seed for Julia's Random Number Generator
#' @description Sets the seed for Julia's random number generator to ensure reproducibility.
#' @param julia_seed An integer seed value to be passed to Julia's random number generator.
#' @details This function initializes the necessary Julia functions and sets the random seed for Julia. 
#' If the provided seed is NULL, the function does nothing.
#' @author Your Name (or the appropriate author's name)
#' @export
setJuliaSeed <- function(julia_seed){
  addJuliaFunctions()
  if (!is.null(julia_seed)){
    JuliaConnectoR::juliaEval(paste0('Random.seed!(Int64(', julia_seed, '))', collapse=""))
  }
}

Try the coconots package in your browser

Any scripts or data that you put into this service are public.

coconots documentation built on Oct. 1, 2023, 5:06 p.m.